()
| 17 | } |
| 18 | |
| 19 | func getCmd() *cobra.Command { |
| 20 | cmd := &cobra.Command{ |
| 21 | Use: "get-app --output-format [json|tree]", |
| 22 | Short: "Get application settings", |
| 23 | Long: heredoc.Doc(` |
| 24 | Get the application settings. |
| 25 | |
| 26 | Application level settings allow you to configure settings that |
| 27 | impact all the channel types in your app. |
| 28 | `), |
| 29 | Example: heredoc.Doc(` |
| 30 | # Print the application settings in json format (default format) |
| 31 | $ stream-cli chat get-app |
| 32 | |
| 33 | # Print the application settings in a browsable tree |
| 34 | $ stream-cli chat get-app --output-format tree |
| 35 | |
| 36 | # Print the application settings for another application |
| 37 | $ stream-cli chat get-app --app testenvironment |
| 38 | |
| 39 | # Note: |
| 40 | # Use this command to list all the available Stream applications |
| 41 | $ stream-cli config list |
| 42 | `), |
| 43 | RunE: func(cmd *cobra.Command, args []string) error { |
| 44 | c, err := config.GetConfig(cmd).GetClient(cmd) |
| 45 | if err != nil { |
| 46 | return err |
| 47 | } |
| 48 | |
| 49 | r, err := c.GetAppSettings(cmd.Context()) |
| 50 | if err != nil { |
| 51 | return err |
| 52 | } |
| 53 | |
| 54 | return utils.PrintObject(cmd, r.App) |
| 55 | }, |
| 56 | } |
| 57 | |
| 58 | fl := cmd.Flags() |
| 59 | fl.StringP("output-format", "o", "json", "[optional] Output format. Can be json or tree") |
| 60 | |
| 61 | return cmd |
| 62 | } |
| 63 | |
| 64 | func updateCmd() *cobra.Command { |
| 65 | cmd := &cobra.Command{ |
no test coverage detected