newUnpauseCommand creates a new cobra.Command for "docker container unpause".
(dockerCLI command.Cli)
| 19 | |
| 20 | // newUnpauseCommand creates a new cobra.Command for "docker container unpause". |
| 21 | func newUnpauseCommand(dockerCLI command.Cli) *cobra.Command { |
| 22 | var opts unpauseOptions |
| 23 | |
| 24 | cmd := &cobra.Command{ |
| 25 | Use: "unpause CONTAINER [CONTAINER...]", |
| 26 | Short: "Unpause all processes within one or more containers", |
| 27 | Args: cli.RequiresMinArgs(1), |
| 28 | RunE: func(cmd *cobra.Command, args []string) error { |
| 29 | opts.containers = args |
| 30 | return runUnpause(cmd.Context(), dockerCLI, &opts) |
| 31 | }, |
| 32 | Annotations: map[string]string{ |
| 33 | "aliases": "docker container unpause, docker unpause", |
| 34 | }, |
| 35 | ValidArgsFunction: completion.ContainerNames(dockerCLI, false, func(ctr container.Summary) bool { |
| 36 | return ctr.State == container.StatePaused |
| 37 | }), |
| 38 | DisableFlagsInUseLine: true, |
| 39 | } |
| 40 | return cmd |
| 41 | } |
| 42 | |
| 43 | func runUnpause(ctx context.Context, dockerCLI command.Cli, opts *unpauseOptions) error { |
| 44 | apiClient := dockerCLI.Client() |
no test coverage detected
searching dependent graphs…