From fd5673eeb955f79eca9ce84469afb3dd688dde50 Mon Sep 17 00:00:00 2001 From: Aaron Lehmann Date: Thu, 10 Nov 2016 12:05:19 -0800 Subject: [PATCH] cli: Change autolock flag description This change incorporates feedback from @thaJeztah in the PR that added the autolock flag. It changes the descriptions to be different for "swarm init" and "swarm update" so that the boolean nature so that the purpose of the flag in both contexts is clearer. Signed-off-by: Aaron Lehmann --- command/swarm/init.go | 1 + command/swarm/opts.go | 1 - command/swarm/update.go | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/command/swarm/init.go b/command/swarm/init.go index 93c97c3a74..2550feeb47 100644 --- a/command/swarm/init.go +++ b/command/swarm/init.go @@ -40,6 +40,7 @@ func newInitCommand(dockerCli *command.DockerCli) *cobra.Command { flags.Var(&opts.listenAddr, flagListenAddr, "Listen address (format: [:port])") flags.StringVar(&opts.advertiseAddr, flagAdvertiseAddr, "", "Advertised address (format: [:port])") flags.BoolVar(&opts.forceNewCluster, "force-new-cluster", false, "Force create a new cluster from current state") + flags.BoolVar(&opts.autolock, flagAutolock, false, "Enable manager autolocking (requiring an unlock key to start a stopped manager)") addSwarmFlags(flags, &opts.swarmOptions) return cmd } diff --git a/command/swarm/opts.go b/command/swarm/opts.go index 8682375b15..885a3cd04e 100644 --- a/command/swarm/opts.go +++ b/command/swarm/opts.go @@ -176,7 +176,6 @@ func addSwarmFlags(flags *pflag.FlagSet, opts *swarmOptions) { flags.Var(&opts.externalCA, flagExternalCA, "Specifications of one or more certificate signing endpoints") flags.Uint64Var(&opts.maxSnapshots, flagMaxSnapshots, 0, "Number of additional Raft snapshots to retain") flags.Uint64Var(&opts.snapshotInterval, flagSnapshotInterval, 10000, "Number of log entries between Raft snapshots") - flags.BoolVar(&opts.autolock, flagAutolock, false, "Enable or disable manager autolocking (requiring an unlock key to start a stopped manager)") } func (opts *swarmOptions) mergeSwarmSpec(spec *swarm.Spec, flags *pflag.FlagSet) { diff --git a/command/swarm/update.go b/command/swarm/update.go index 7c88760492..cb0d83ef26 100644 --- a/command/swarm/update.go +++ b/command/swarm/update.go @@ -25,6 +25,7 @@ func newUpdateCommand(dockerCli *command.DockerCli) *cobra.Command { }, } + cmd.Flags().BoolVar(&opts.autolock, flagAutolock, false, "Change manager autolocking setting (true|false)") addSwarmFlags(cmd.Flags(), &opts) return cmd }