Skip to content

Commit 4b32883

Browse files
committed
Normalize the representation of string and number argument values
Signed-off-by: Richard Gibson <richard.gibson@gmail.com>
1 parent 31688d1 commit 4b32883

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

cli/command/container/opts.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ func addFlags(flags *pflag.FlagSet) *containerOptions {
169169
flags.VarP(&copts.attach, "attach", "a", "Attach to STDIN, STDOUT or STDERR")
170170
flags.Var(&copts.deviceCgroupRules, "device-cgroup-rule", "Add a rule to the cgroup allowed devices list")
171171
flags.Var(&copts.devices, "device", "Add a host device to the container")
172-
flags.Var(&copts.gpus, "gpus", "GPU devices to add to the container ('all' to pass all GPUs)")
172+
flags.Var(&copts.gpus, "gpus", `GPU devices to add to the container ("all" to pass all GPUs)`)
173173
flags.SetAnnotation("gpus", "version", []string{"1.40"})
174174
flags.VarP(&copts.env, "env", "e", "Set environment variables")
175175
flags.Var(&copts.envFile, "env-file", "Read in a file of environment variables")
@@ -280,7 +280,7 @@ func addFlags(flags *pflag.FlagSet) *containerOptions {
280280
flags.Var(&copts.kernelMemory, "kernel-memory", "Kernel memory limit")
281281
flags.VarP(&copts.memory, "memory", "m", "Memory limit")
282282
flags.Var(&copts.memoryReservation, "memory-reservation", "Memory soft limit")
283-
flags.Var(&copts.memorySwap, "memory-swap", "Swap limit equal to memory plus swap: '-1' to enable unlimited swap")
283+
flags.Var(&copts.memorySwap, "memory-swap", "Swap limit equal to memory plus swap: -1 to enable unlimited swap")
284284
flags.Int64Var(&copts.swappiness, "memory-swappiness", -1, "Tune container memory swappiness (0 to 100)")
285285
flags.BoolVar(&copts.oomKillDisable, "oom-kill-disable", false, "Disable OOM Killer")
286286
flags.IntVar(&copts.oomScoreAdj, "oom-score-adj", 0, "Tune host's OOM preferences (-1000 to 1000)")

cli/command/container/update.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func NewUpdateCommand(dockerCli command.Cli) *cobra.Command {
6363
flags.Int64VarP(&options.cpuShares, "cpu-shares", "c", 0, "CPU shares (relative weight)")
6464
flags.VarP(&options.memory, "memory", "m", "Memory limit")
6565
flags.Var(&options.memoryReservation, "memory-reservation", "Memory soft limit")
66-
flags.Var(&options.memorySwap, "memory-swap", "Swap limit equal to memory plus swap: '-1' to enable unlimited swap")
66+
flags.Var(&options.memorySwap, "memory-swap", "Swap limit equal to memory plus swap: -1 to enable unlimited swap")
6767
flags.Var(&options.kernelMemory, "kernel-memory", "Kernel memory limit")
6868
flags.StringVar(&options.restartPolicy, "restart", "", "Restart policy to apply when a container exits")
6969
flags.Int64Var(&options.pidsLimit, "pids-limit", 0, "Tune container pids limit (set -1 for unlimited)")

cli/command/image/build.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ func NewBuildCommand(dockerCli command.Cli) *cobra.Command {
110110

111111
flags := cmd.Flags()
112112

113-
flags.VarP(&options.tags, "tag", "t", "Name and optionally a tag in the 'name:tag' format")
113+
flags.VarP(&options.tags, "tag", "t", `Name and optionally a tag in the "name:tag" format`)
114114
flags.Var(&options.buildArgs, "build-arg", "Set build-time variables")
115115
flags.Var(options.ulimits, "ulimit", "Ulimit options")
116-
flags.StringVarP(&options.dockerfileName, "file", "f", "", "Name of the Dockerfile (Default is 'PATH/Dockerfile')")
116+
flags.StringVarP(&options.dockerfileName, "file", "f", "", `Name of the Dockerfile (Default is "PATH/Dockerfile")`)
117117
flags.VarP(&options.memory, "memory", "m", "Memory limit")
118-
flags.Var(&options.memorySwap, "memory-swap", "Swap limit equal to memory plus swap: '-1' to enable unlimited swap")
118+
flags.Var(&options.memorySwap, "memory-swap", "Swap limit equal to memory plus swap: -1 to enable unlimited swap")
119119
flags.Var(&options.shmSize, "shm-size", "Size of /dev/shm")
120120
flags.Int64VarP(&options.cpuShares, "cpu-shares", "c", 0, "CPU shares (relative weight)")
121121
flags.Int64Var(&options.cpuPeriod, "cpu-period", 0, "Limit the CPU CFS (Completely Fair Scheduler) period")

0 commit comments

Comments
 (0)