| 27 | ) |
| 28 | |
| 29 | func RemoveCommand() *cobra.Command { |
| 30 | var cmd = &cobra.Command{ |
| 31 | Use: "rm [flags] CONTAINER [CONTAINER, ...]", |
| 32 | Args: cobra.MinimumNArgs(1), |
| 33 | Short: "Remove one or more containers", |
| 34 | RunE: removeAction, |
| 35 | ValidArgsFunction: rmShellComplete, |
| 36 | SilenceUsage: true, |
| 37 | SilenceErrors: true, |
| 38 | } |
| 39 | cmd.Aliases = []string{"remove"} |
| 40 | cmd.Flags().BoolP("force", "f", false, "Force the removal of a running|paused|unknown container (uses SIGKILL)") |
| 41 | cmd.Flags().BoolP("volumes", "v", false, "Remove volumes associated with the container") |
| 42 | return cmd |
| 43 | } |
| 44 | |
| 45 | func removeAction(cmd *cobra.Command, args []string) error { |
| 46 | globalOptions, err := helpers.ProcessRootCmdFlags(cmd) |