| 47 | } |
| 48 | |
| 49 | func removeAppCmd() *cobra.Command { |
| 50 | return &cobra.Command{ |
| 51 | Use: "remove [app-name-1] [app-name-2] [app-name-n]", |
| 52 | Short: "Remove one or more application.", |
| 53 | Long: "Remove one or more application from the configuration file. This operation is irrevocable.", |
| 54 | Example: heredoc.Doc(` |
| 55 | # Remove a single application from the CLI |
| 56 | $ stream-cli config remove staging |
| 57 | |
| 58 | # Remove multiple applications from the CLI |
| 59 | $ stream-cli config remove staging testing |
| 60 | `), |
| 61 | Args: cobra.MinimumNArgs(1), |
| 62 | RunE: func(cmd *cobra.Command, args []string) error { |
| 63 | config := cfg.GetConfig(cmd) |
| 64 | for _, appName := range args { |
| 65 | if err := config.Remove(appName); err != nil { |
| 66 | return err |
| 67 | } |
| 68 | cmd.Printf("[%s] application successfully removed.\n", appName) |
| 69 | } |
| 70 | |
| 71 | return nil |
| 72 | }, |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | func listAppsCmd() *cobra.Command { |
| 77 | return &cobra.Command{ |