From 8aae16b9efb45a88935c4abbc24d24d2a7a94c41 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 6 Jul 2024 00:58:35 +0200 Subject: [PATCH] cli/command/container: add completion for --volumes-from With this patch: docker run --volumes-from amazing_nobel amazing_cannon boring_wozniak determined_banzai elegant_solomon reverent_booth amazing_nobel Signed-off-by: Sebastiaan van Stijn --- cli/command/container/create.go | 1 + cli/command/container/run.go | 1 + 2 files changed, 2 insertions(+) diff --git a/cli/command/container/create.go b/cli/command/container/create.go index d080ae5ea558..a14520fb1a30 100644 --- a/cli/command/container/create.go +++ b/cli/command/container/create.go @@ -85,6 +85,7 @@ func NewCreateCommand(dockerCli command.Cli) *cobra.Command { _ = cmd.RegisterFlagCompletionFunc("network", completion.NetworkNames(dockerCli)) _ = cmd.RegisterFlagCompletionFunc("pull", completion.FromList(PullImageAlways, PullImageMissing, PullImageNever)) _ = cmd.RegisterFlagCompletionFunc("restart", completeRestartPolicies) + _ = cmd.RegisterFlagCompletionFunc("volumes-from", completion.ContainerNames(dockerCli, true)) return cmd } diff --git a/cli/command/container/run.go b/cli/command/container/run.go index ae36443df4ef..046ab599ae7d 100644 --- a/cli/command/container/run.go +++ b/cli/command/container/run.go @@ -76,6 +76,7 @@ func NewRunCommand(dockerCli command.Cli) *cobra.Command { _ = cmd.RegisterFlagCompletionFunc("network", completion.NetworkNames(dockerCli)) _ = cmd.RegisterFlagCompletionFunc("pull", completion.FromList(PullImageAlways, PullImageMissing, PullImageNever)) _ = cmd.RegisterFlagCompletionFunc("restart", completeRestartPolicies) + _ = cmd.RegisterFlagCompletionFunc("volumes-from", completion.ContainerNames(dockerCli, true)) return cmd }