From f9ccc503046bb1b8ccd531dfa27e1abea3742664 Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Wed, 23 Oct 2024 13:09:13 +0000 Subject: [PATCH] Add completion for `--attach` Signed-off-by: Harald Albers (cherry picked from commit b598ec8cdb589af30d78c15276b1fe7c02c8247b) Signed-off-by: Sebastiaan van Stijn --- cli/command/container/completion.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cli/command/container/completion.go b/cli/command/container/completion.go index fb8193b4ca..53e6664452 100644 --- a/cli/command/container/completion.go +++ b/cli/command/container/completion.go @@ -56,6 +56,7 @@ var restartPolicies = []string{ // addCompletions adds the completions that `run` and `create` have in common. func addCompletions(cmd *cobra.Command, dockerCLI completion.APIClientProvider) { + _ = cmd.RegisterFlagCompletionFunc("attach", completion.FromList("stderr", "stdin", "stdout")) _ = cmd.RegisterFlagCompletionFunc("cap-add", completeLinuxCapabilityNames) _ = cmd.RegisterFlagCompletionFunc("cap-drop", completeLinuxCapabilityNames) _ = cmd.RegisterFlagCompletionFunc("env", completion.EnvVarNames)