Browse code

cli: Add valid suffixes for remaining duration options

A recent PR added `(ns|us|ms|s|m|h)` to the descriptions of some
duration options, but not all. Add it to the remaining options for
consistency.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit 32b12a28fcab98b79c9176fb78b5620a46906916)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>

Aaron Lehmann authored on 2016/11/12 10:44:42
Showing 3 changed files
... ...
@@ -575,14 +575,14 @@ func addServiceFlags(cmd *cobra.Command, opts *serviceOptions) {
575 575
 	flags.Var(&opts.resources.limitMemBytes, flagLimitMemory, "Limit Memory")
576 576
 	flags.Var(&opts.resources.resCPU, flagReserveCPU, "Reserve CPUs")
577 577
 	flags.Var(&opts.resources.resMemBytes, flagReserveMemory, "Reserve Memory")
578
-	flags.Var(&opts.stopGrace, flagStopGracePeriod, "Time to wait before force killing a container")
578
+	flags.Var(&opts.stopGrace, flagStopGracePeriod, "Time to wait before force killing a container (ns|us|ms|s|m|h)")
579 579
 
580 580
 	flags.Var(&opts.replicas, flagReplicas, "Number of tasks")
581 581
 
582 582
 	flags.StringVar(&opts.restartPolicy.condition, flagRestartCondition, "", "Restart when condition is met (none, on-failure, or any)")
583
-	flags.Var(&opts.restartPolicy.delay, flagRestartDelay, "Delay between restart attempts")
583
+	flags.Var(&opts.restartPolicy.delay, flagRestartDelay, "Delay between restart attempts (ns|us|ms|s|m|h)")
584 584
 	flags.Var(&opts.restartPolicy.maxAttempts, flagRestartMaxAttempts, "Maximum number of restarts before giving up")
585
-	flags.Var(&opts.restartPolicy.window, flagRestartWindow, "Window used to evaluate the restart policy")
585
+	flags.Var(&opts.restartPolicy.window, flagRestartWindow, "Window used to evaluate the restart policy (ns|us|ms|s|m|h)")
586 586
 
587 587
 	flags.Uint64Var(&opts.update.parallelism, flagUpdateParallelism, 1, "Maximum number of tasks updated simultaneously (0 to update all at once)")
588 588
 	flags.DurationVar(&opts.update.delay, flagUpdateDelay, time.Duration(0), "Delay between updates (ns|us|ms|s|m|h) (default 0s)")
... ...
@@ -598,8 +598,8 @@ func addServiceFlags(cmd *cobra.Command, opts *serviceOptions) {
598 598
 	flags.Var(&opts.logDriver.opts, flagLogOpt, "Logging driver options")
599 599
 
600 600
 	flags.StringVar(&opts.healthcheck.cmd, flagHealthCmd, "", "Command to run to check health")
601
-	flags.Var(&opts.healthcheck.interval, flagHealthInterval, "Time between running the check")
602
-	flags.Var(&opts.healthcheck.timeout, flagHealthTimeout, "Maximum time to allow one check to run")
601
+	flags.Var(&opts.healthcheck.interval, flagHealthInterval, "Time between running the check (ns|us|ms|s|m|h)")
602
+	flags.Var(&opts.healthcheck.timeout, flagHealthTimeout, "Maximum time to allow one check to run (ns|us|ms|s|m|h)")
603 603
 	flags.IntVar(&opts.healthcheck.retries, flagHealthRetries, 0, "Consecutive failures needed to report unhealthy")
604 604
 	flags.BoolVar(&opts.healthcheck.noHealthcheck, flagNoHealthcheck, false, "Disable any container-specified HEALTHCHECK")
605 605
 
... ...
@@ -31,9 +31,9 @@ Options:
31 31
       --env-file list                    Read in a file of environment variables (default [])
32 32
       --group list                       Set one or more supplementary user groups for the container (default [])
33 33
       --health-cmd string                Command to run to check health
34
-      --health-interval duration         Time between running the check (default none)
34
+      --health-interval duration         Time between running the check (ns|us|ms|s|m|h) (default none)
35 35
       --health-retries int               Consecutive failures needed to report unhealthy
36
-      --health-timeout duration          Maximum time to allow one check to run (default none)
36
+      --health-timeout duration          Maximum time to allow one check to run (ns|us|ms|s|m|h) (default none)
37 37
       --help                             Print usage
38 38
       --host list                        Set one or more custom host-to-IP mappings (host:ip) (default [])
39 39
       --hostname string                  Container hostname
... ...
@@ -52,11 +52,11 @@ Options:
52 52
       --reserve-cpu decimal              Reserve CPUs (default 0.000)
53 53
       --reserve-memory bytes             Reserve Memory (default 0 B)
54 54
       --restart-condition string         Restart when condition is met (none, on-failure, or any)
55
-      --restart-delay duration           Delay between restart attempts (default none)
55
+      --restart-delay duration           Delay between restart attempts (ns|us|ms|s|m|h) (default none)
56 56
       --restart-max-attempts uint        Maximum number of restarts before giving up (default none)
57
-      --restart-window duration          Window used to evaluate the restart policy (default none)
57
+      --restart-window duration          Window used to evaluate the restart policy (ns|us|ms|s|m|h) (default none)
58 58
       --secret value                     Specify secrets to expose to the service (default [])
59
-      --stop-grace-period duration       Time to wait before force killing a container (default none)
59
+      --stop-grace-period duration       Time to wait before force killing a container (ns|us|ms|s|m|h) (default none)
60 60
   -t, --tty                              Allocate a pseudo-TTY
61 61
       --update-delay duration            Delay between updates (ns|us|ms|s|m|h) (default 0s)
62 62
       --update-failure-action string     Action on update failure (pause|continue) (default "pause")
... ...
@@ -39,9 +39,9 @@ Options:
39 39
       --group-add list                   Add an additional supplementary user group to the container (default [])
40 40
       --group-rm list                    Remove a previously added supplementary user group from the container (default [])
41 41
       --health-cmd string                Command to run to check health
42
-      --health-interval duration         Time between running the check (default none)
42
+      --health-interval duration         Time between running the check (ns|us|ms|s|m|h) (default none)
43 43
       --health-retries int               Consecutive failures needed to report unhealthy
44
-      --health-timeout duration          Maximum time to allow one check to run (default none)
44
+      --health-timeout duration          Maximum time to allow one check to run (ns|us|ms|s|m|h) (default none)
45 45
       --help                             Print usage
46 46
       --host-add list                    Add or update a custom host-to-IP mapping (host:ip) (default [])
47 47
       --host-rm list                     Remove a custom host-to-IP mapping (host:ip) (default [])
... ...
@@ -61,13 +61,13 @@ Options:
61 61
       --reserve-cpu decimal              Reserve CPUs (default 0.000)
62 62
       --reserve-memory bytes             Reserve Memory (default 0 B)
63 63
       --restart-condition string         Restart when condition is met (none, on-failure, or any)
64
-      --restart-delay duration           Delay between restart attempts (default none)
64
+      --restart-delay duration           Delay between restart attempts (ns|us|ms|s|m|h) (default none)
65 65
       --restart-max-attempts uint        Maximum number of restarts before giving up (default none)
66
-      --restart-window duration          Window used to evaluate the restart policy (default none)
66
+      --restart-window duration          Window used to evaluate the restart policy (ns|us|ms|s|m|h) (default none)
67 67
       --rollback                         Rollback to previous specification
68 68
       --secret-add list                  Add a secret (default [])
69 69
       --secret-rm list                   Remove a secret (default [])
70
-      --stop-grace-period duration       Time to wait before force killing a container (default none)
70
+      --stop-grace-period duration       Time to wait before force killing a container (ns|us|ms|s|m|h) (default none)
71 71
   -t, --tty                              Allocate a pseudo-TTY
72 72
       --update-delay duration            Delay between updates (ns|us|ms|s|m|h) (default 0s)
73 73
       --update-failure-action string     Action on update failure (pause|continue) (default "pause")