| 28 | ) |
| 29 | |
| 30 | func RestartCommand() *cobra.Command { |
| 31 | var cmd = &cobra.Command{ |
| 32 | Use: "restart [flags] CONTAINER [CONTAINER, ...]", |
| 33 | Args: cobra.MinimumNArgs(1), |
| 34 | Short: "Restart one or more running containers", |
| 35 | RunE: restartAction, |
| 36 | ValidArgsFunction: startShellComplete, |
| 37 | SilenceUsage: true, |
| 38 | SilenceErrors: true, |
| 39 | } |
| 40 | cmd.Flags().UintP("time", "t", 10, "Seconds to wait for stop before killing it") |
| 41 | cmd.Flags().StringP("signal", "s", "", "Signal to send to stop the container, before killing it") |
| 42 | return cmd |
| 43 | } |
| 44 | |
| 45 | func restartOptions(cmd *cobra.Command) (types.ContainerRestartOptions, error) { |
| 46 | globalOptions, err := helpers.ProcessRootCmdFlags(cmd) |