Skip to content

Commit

Permalink
Merge pull request moby#30814 from YuPengZTE/devSwarmCliExplain
Browse files Browse the repository at this point in the history
fix the type
  • Loading branch information
thaJeztah authored Feb 20, 2017
2 parents e858f5f + 03aed78 commit 0eacd8a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions command/node/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ func newUpdateCommand(dockerCli command.Cli) *cobra.Command {
}

flags := cmd.Flags()
flags.StringVar(&nodeOpts.role, flagRole, "", "Role of the node (worker/manager)")
flags.StringVar(&nodeOpts.availability, flagAvailability, "", "Availability of the node (active/pause/drain)")
flags.StringVar(&nodeOpts.role, flagRole, "", `Role of the node ("worker"|"manager")`)
flags.StringVar(&nodeOpts.availability, flagAvailability, "", `Availability of the node ("active"|"pause"|"drain")`)
flags.Var(&nodeOpts.annotations.labels, flagLabelAdd, "Add or update a node label (key=value)")
labelKeys := opts.NewListOpts(nil)
flags.Var(&labelKeys, flagLabelRemove, "Remove a node label if exists")
Expand Down
4 changes: 2 additions & 2 deletions command/service/opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ func addServiceFlags(cmd *cobra.Command, opts *serviceOptions) {

flags.Var(&opts.replicas, flagReplicas, "Number of tasks")

flags.StringVar(&opts.restartPolicy.condition, flagRestartCondition, "", "Restart when condition is met (none, on-failure, or any)")
flags.StringVar(&opts.restartPolicy.condition, flagRestartCondition, "", `Restart when condition is met ("none"|"on-failure"|"any")`)
flags.Var(&opts.restartPolicy.delay, flagRestartDelay, "Delay between restart attempts (ns|us|ms|s|m|h)")
flags.Var(&opts.restartPolicy.maxAttempts, flagRestartMaxAttempts, "Maximum number of restarts before giving up")
flags.Var(&opts.restartPolicy.window, flagRestartWindow, "Window used to evaluate the restart policy (ns|us|ms|s|m|h)")
Expand All @@ -443,7 +443,7 @@ func addServiceFlags(cmd *cobra.Command, opts *serviceOptions) {
flags.DurationVar(&opts.update.delay, flagUpdateDelay, time.Duration(0), "Delay between updates (ns|us|ms|s|m|h) (default 0s)")
flags.DurationVar(&opts.update.monitor, flagUpdateMonitor, time.Duration(0), "Duration after each task update to monitor for failure (ns|us|ms|s|m|h) (default 0s)")
flags.SetAnnotation(flagUpdateMonitor, "version", []string{"1.25"})
flags.StringVar(&opts.update.onFailure, flagUpdateFailureAction, "pause", "Action on update failure (pause|continue)")
flags.StringVar(&opts.update.onFailure, flagUpdateFailureAction, "pause", `Action on update failure ("pause"|"continue")`)
flags.Var(&opts.update.maxFailureRatio, flagUpdateMaxFailureRatio, "Failure rate to tolerate during an update")
flags.SetAnnotation(flagUpdateMaxFailureRatio, "version", []string{"1.25"})

Expand Down
2 changes: 1 addition & 1 deletion command/swarm/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func newInitCommand(dockerCli command.Cli) *cobra.Command {
flags.StringVar(&opts.advertiseAddr, flagAdvertiseAddr, "", "Advertised address (format: <ip|interface>[: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)")
flags.StringVar(&opts.availability, flagAvailability, "active", "Availability of the node (active/pause/drain)")
flags.StringVar(&opts.availability, flagAvailability, "active", `Availability of the node ("active"|"pause"|"drain")`)
addSwarmFlags(flags, &opts.swarmOptions)
return cmd
}
Expand Down
2 changes: 1 addition & 1 deletion command/swarm/join.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func newJoinCommand(dockerCli command.Cli) *cobra.Command {
flags.Var(&opts.listenAddr, flagListenAddr, "Listen address (format: <ip|interface>[:port])")
flags.StringVar(&opts.advertiseAddr, flagAdvertiseAddr, "", "Advertised address (format: <ip|interface>[:port])")
flags.StringVar(&opts.token, flagToken, "", "Token for entry into the swarm")
flags.StringVar(&opts.availability, flagAvailability, "active", "Availability of the node (active/pause/drain)")
flags.StringVar(&opts.availability, flagAvailability, "active", `Availability of the node ("active"|"pause"|"drain")`)
return cmd
}

Expand Down
2 changes: 1 addition & 1 deletion flags/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (commonOpts *CommonOptions) InstallFlags(flags *pflag.FlagSet) {
}

flags.BoolVarP(&commonOpts.Debug, "debug", "D", false, "Enable debug mode")
flags.StringVarP(&commonOpts.LogLevel, "log-level", "l", "info", "Set the logging level (\"debug\", \"info\", \"warn\", \"error\", \"fatal\")")
flags.StringVarP(&commonOpts.LogLevel, "log-level", "l", "info", `Set the logging level ("debug"|"info"|"warn"|"error"|"fatal")`)
flags.BoolVar(&commonOpts.TLS, "tls", false, "Use TLS; implied by --tlsverify")
flags.BoolVar(&commonOpts.TLSVerify, FlagTLSVerify, dockerTLSVerify, "Use TLS and verify the remote")

Expand Down

0 comments on commit 0eacd8a

Please sign in to comment.