MCPcopy Index your code
hub / github.com/docker/cli / newWaitCommand

Function newWaitCommand

cli/command/container/wait.go:21–40  ·  view source on GitHub ↗

newWaitCommand creates a new cobra.Command for "docker container wait".

(dockerCLI command.Cli)

Source from the content-addressed store, hash-verified

19
20// newWaitCommand creates a new cobra.Command for "docker container wait".
21func newWaitCommand(dockerCLI command.Cli) *cobra.Command {
22 var opts waitOptions
23
24 cmd := &cobra.Command{
25 Use: "wait CONTAINER [CONTAINER...]",
26 Short: "Block until one or more containers stop, then print their exit codes",
27 Args: cli.RequiresMinArgs(1),
28 RunE: func(cmd *cobra.Command, args []string) error {
29 opts.containers = args
30 return runWait(cmd.Context(), dockerCLI, &opts)
31 },
32 Annotations: map[string]string{
33 "aliases": "docker container wait, docker wait",
34 },
35 ValidArgsFunction: completion.ContainerNames(dockerCLI, false),
36 DisableFlagsInUseLine: true,
37 }
38
39 return cmd
40}
41
42func runWait(ctx context.Context, dockerCLI command.Cli, opts *waitOptions) error {
43 apiClient := dockerCLI.Client()

Callers 1

newContainerCommandFunction · 0.85

Calls 1

runWaitFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…