diff --git a/cli/command/checkpoint/create.go b/cli/command/checkpoint/create.go index e72bbb9b12..3ea41ee85f 100644 --- a/cli/command/checkpoint/create.go +++ b/cli/command/checkpoint/create.go @@ -35,7 +35,7 @@ func newCreateCommand(dockerCli command.Cli) *cobra.Command { flags := cmd.Flags() flags.BoolVar(&opts.leaveRunning, "leave-running", false, "Leave the container running after checkpoint") - flags.StringVarP(&opts.checkpointDir, "checkpoint-dir", "", "", "Use a custom checkpoint storage directory") + flags.StringVar(&opts.checkpointDir, "checkpoint-dir", "", "Use a custom checkpoint storage directory") return cmd } diff --git a/cli/command/checkpoint/list.go b/cli/command/checkpoint/list.go index bddea60acd..55344e08c9 100644 --- a/cli/command/checkpoint/list.go +++ b/cli/command/checkpoint/list.go @@ -30,7 +30,7 @@ func newListCommand(dockerCli command.Cli) *cobra.Command { } flags := cmd.Flags() - flags.StringVarP(&opts.checkpointDir, "checkpoint-dir", "", "", "Use a custom checkpoint storage directory") + flags.StringVar(&opts.checkpointDir, "checkpoint-dir", "", "Use a custom checkpoint storage directory") return cmd } diff --git a/cli/command/checkpoint/remove.go b/cli/command/checkpoint/remove.go index ba8d4095da..7308948b39 100644 --- a/cli/command/checkpoint/remove.go +++ b/cli/command/checkpoint/remove.go @@ -27,7 +27,7 @@ func newRemoveCommand(dockerCli command.Cli) *cobra.Command { } flags := cmd.Flags() - flags.StringVarP(&opts.checkpointDir, "checkpoint-dir", "", "", "Use a custom checkpoint storage directory") + flags.StringVar(&opts.checkpointDir, "checkpoint-dir", "", "Use a custom checkpoint storage directory") return cmd } diff --git a/cli/command/config/ls.go b/cli/command/config/ls.go index c8cb4337e0..5498506780 100644 --- a/cli/command/config/ls.go +++ b/cli/command/config/ls.go @@ -38,7 +38,7 @@ func newConfigListCommand(dockerCli command.Cli) *cobra.Command { flags := cmd.Flags() flags.BoolVarP(&listOpts.Quiet, "quiet", "q", false, "Only display IDs") - flags.StringVarP(&listOpts.Format, "format", "", "", flagsHelper.FormatHelp) + flags.StringVar(&listOpts.Format, "format", "", flagsHelper.FormatHelp) flags.VarP(&listOpts.Filter, "filter", "f", "Filter output based on conditions provided") return cmd diff --git a/cli/command/container/exec.go b/cli/command/container/exec.go index 625f4571e3..e1dc6716af 100644 --- a/cli/command/container/exec.go +++ b/cli/command/container/exec.go @@ -66,12 +66,12 @@ func NewExecCommand(dockerCli command.Cli) *cobra.Command { flags := cmd.Flags() flags.SetInterspersed(false) - flags.StringVarP(&options.DetachKeys, "detach-keys", "", "", "Override the key sequence for detaching a container") + flags.StringVar(&options.DetachKeys, "detach-keys", "", "Override the key sequence for detaching a container") flags.BoolVarP(&options.Interactive, "interactive", "i", false, "Keep STDIN open even if not attached") flags.BoolVarP(&options.TTY, "tty", "t", false, "Allocate a pseudo-TTY") flags.BoolVarP(&options.Detach, "detach", "d", false, "Detached mode: run command in the background") flags.StringVarP(&options.User, "user", "u", "", `Username or UID (format: "[:]")`) - flags.BoolVarP(&options.Privileged, "privileged", "", false, "Give extended privileges to the command") + flags.BoolVar(&options.Privileged, "privileged", false, "Give extended privileges to the command") flags.VarP(&options.Env, "env", "e", "Set environment variables") flags.SetAnnotation("env", "version", []string{"1.25"}) flags.Var(&options.EnvFile, "env-file", "Read in a file of environment variables") diff --git a/cli/command/container/list.go b/cli/command/container/list.go index 7e466b02e3..4523fe51d2 100644 --- a/cli/command/container/list.go +++ b/cli/command/container/list.go @@ -55,7 +55,7 @@ func NewPsCommand(dockerCLI command.Cli) *cobra.Command { flags.BoolVar(&options.noTrunc, "no-trunc", false, "Don't truncate output") flags.BoolVarP(&options.nLatest, "latest", "l", false, "Show the latest created container (includes all states)") flags.IntVarP(&options.last, "last", "n", -1, "Show n last created containers (includes all states)") - flags.StringVarP(&options.format, "format", "", "", flagsHelper.FormatHelp) + flags.StringVar(&options.format, "format", "", flagsHelper.FormatHelp) flags.VarP(&options.filter, "filter", "f", "Filter output based on conditions provided") return cmd diff --git a/cli/command/registry/login.go b/cli/command/registry/login.go index 3a52203e1f..f43db587db 100644 --- a/cli/command/registry/login.go +++ b/cli/command/registry/login.go @@ -55,7 +55,7 @@ func NewLoginCommand(dockerCli command.Cli) *cobra.Command { flags.StringVarP(&opts.user, "username", "u", "", "Username") flags.StringVarP(&opts.password, "password", "p", "", "Password") - flags.BoolVarP(&opts.passwordStdin, "password-stdin", "", false, "Take the password from stdin") + flags.BoolVar(&opts.passwordStdin, "password-stdin", false, "Take the password from stdin") return cmd } diff --git a/cli/command/secret/ls.go b/cli/command/secret/ls.go index 11a5620518..869e4f16d3 100644 --- a/cli/command/secret/ls.go +++ b/cli/command/secret/ls.go @@ -38,7 +38,7 @@ func newSecretListCommand(dockerCli command.Cli) *cobra.Command { flags := cmd.Flags() flags.BoolVarP(&options.quiet, "quiet", "q", false, "Only display IDs") - flags.StringVarP(&options.format, "format", "", "", flagsHelper.FormatHelp) + flags.StringVar(&options.format, "format", "", flagsHelper.FormatHelp) flags.VarP(&options.filter, "filter", "f", "Filter output based on conditions provided") return cmd diff --git a/cli/command/swarm/ipnet_slice_test.go b/cli/command/swarm/ipnet_slice_test.go index 5a25f554c2..04f07430fd 100644 --- a/cli/command/swarm/ipnet_slice_test.go +++ b/cli/command/swarm/ipnet_slice_test.go @@ -20,7 +20,7 @@ func equalCIDR(c1 net.IPNet, c2 net.IPNet) bool { func setUpIPNetFlagSet(ipsp *[]net.IPNet) *pflag.FlagSet { f := pflag.NewFlagSet("test", pflag.ContinueOnError) - f.VarP(newIPNetSliceValue([]net.IPNet{}, ipsp), "cidrs", "", "Command separated list!") + f.Var(newIPNetSliceValue([]net.IPNet{}, ipsp), "cidrs", "Command separated list!") return f }