Remove -ptr from the help output of service create

This fix is based on the comment:
https://github.com/docker/docker/pull/28147#discussion_r86996347

Previously the output string of the `DurationOpt` is `duration-ptr`
and `Uint64Opt` is `uint64-ptr`. While it is clear to developers,
for a normal user `-ptr` might not be very informative.

On the other hand, the default value of `DurationOpt` and `Uint64Opt`
has already been quite informative: `none`. That means if no flag
provided, the value will be treated as none.
(like a ptr with nil as the default)

For that reason this fix removes the `-ptr`.

Also, the output in the docs of `service create` has been quite
out-of-sync with the true output. So this fix updates the docs
to have the most up-to-date help output of `service create --help`.

This fix is related to #28147.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
Yong Tang 2016-11-08 07:06:07 -08:00 committed by Tibor Vass
parent fc50bad3c2
commit ac4b6e3505
2 changed files with 76 additions and 76 deletions

View File

@ -21,48 +21,48 @@ Usage: docker service create [OPTIONS] IMAGE [COMMAND] [ARG...]
Create a new service Create a new service
Options: Options:
--constraint value Placement constraints (default []) --constraint list Placement constraints (default [])
--container-label value Service container labels (default []) --container-label list Container labels (default [])
--dns list Set custom DNS servers (default []) --dns list Set custom DNS servers (default [])
--dns-options list Set DNS options (default []) --dns-options list Set DNS options (default [])
--dns-search list Set custom DNS search domains (default []) --dns-search list Set custom DNS search domains (default [])
--endpoint-mode string Endpoint mode (vip or dnsrr) --endpoint-mode string Endpoint mode (vip or dnsrr)
-e, --env value Set environment variables (default []) -e, --env list Set environment variables (default [])
--env-file value Read in a file of environment variables (default []) --env-file list Read in a file of environment variables (default [])
--group value Set one or more supplementary user groups for the container (default []) --group list Set one or more supplementary user groups for the container (default [])
--health-cmd string Command to run to check health --health-cmd string Command to run to check health
--health-interval duration Time between running the check (ns|us|ms|s|m|h) (default 0s) --health-interval duration Time between running the check (default none)
--health-retries int Consecutive failures needed to report unhealthy --health-retries int Consecutive failures needed to report unhealthy
--health-timeout duration Maximum time to allow one check to run (ns|us|ms|s|m|h) (default 0s) --health-timeout duration Maximum time to allow one check to run (default none)
--help Print usage --help Print usage
--hostname Service containers hostname --hostname string Container hostname
-l, --label value Service labels (default []) -l, --label list Service labels (default [])
--limit-cpu value Limit CPUs (default 0.000) --limit-cpu decimal Limit CPUs (default 0.000)
--limit-memory value Limit Memory (default 0 B) --limit-memory bytes Limit Memory (default 0 B)
--log-driver string Logging driver for service --log-driver string Logging driver for service
--log-opt value Logging driver options (default []) --log-opt list Logging driver options (default [])
--mode string Service mode (replicated or global) (default "replicated") --mode string Service mode (replicated or global) (default "replicated")
--mount value Attach a filesystem mount to the service --mount mount Attach a filesystem mount to the service
--name string Service name --name string Service name
--network value Network attachments (default []) --network list Network attachments (default [])
--no-healthcheck Disable any container-specified HEALTHCHECK --no-healthcheck Disable any container-specified HEALTHCHECK
-p, --publish value Publish a port as a node port (default []) -p, --publish list Publish a port as a node port (default [])
--replicas value Number of tasks (default none) --replicas uint Number of tasks (default none)
--reserve-cpu value Reserve CPUs (default 0.000) --reserve-cpu decimal Reserve CPUs (default 0.000)
--reserve-memory value Reserve Memory (default 0 B) --reserve-memory bytes Reserve Memory (default 0 B)
--restart-condition string Restart when condition is met (none, on-failure, or any) --restart-condition string Restart when condition is met (none, on-failure, or any)
--restart-delay value Delay between restart attempts (default none) --restart-delay duration Delay between restart attempts (default none)
--restart-max-attempts value Maximum number of restarts before giving up (default none) --restart-max-attempts uint Maximum number of restarts before giving up (default none)
--restart-window value Window used to evaluate the restart policy (default none) --restart-window duration Window used to evaluate the restart policy (default none)
--stop-grace-period value Time to wait before force killing a container (default none) --stop-grace-period duration Time to wait before force killing a container (default none)
-t, --tty Allocate a pseudo-TTY -t, --tty Allocate a pseudo-TTY
--update-delay duration Delay between updates (ns|us|ms|s|m|h) (default 0s) --update-delay duration Delay between updates (ns|us|ms|s|m|h) (default 0s)
--update-failure-action string Action on update failure (pause|continue) (default "pause") --update-failure-action string Action on update failure (pause|continue) (default "pause")
--update-max-failure-ratio value Failure rate to tolerate during an update --update-max-failure-ratio float Failure rate to tolerate during an update
--update-monitor duration Duration after each task update to monitor for failure (ns|us|ms|s|m|h) (default 0s) --update-monitor duration Duration after each task update to monitor for failure (ns|us|ms|s|m|h) (default 0s)
--update-parallelism uint Maximum number of tasks updated simultaneously (0 to update all at once) (default 1) --update-parallelism uint Maximum number of tasks updated simultaneously (0 to update all at once) (default 1)
-u, --user string Username or UID (format: <name|uid>[:<group|gid>]) -u, --user string Username or UID (format: <name|uid>[:<group|gid>])
--with-registry-auth Send registry authentication details to Swarm agents --with-registry-auth Send registry authentication details to swarm agents
-w, --workdir string Working directory inside the container -w, --workdir string Working directory inside the container
``` ```

View File

@ -21,58 +21,58 @@ Usage: docker service update [OPTIONS] SERVICE
Update a service Update a service
Options: Options:
--args string Service command args --args string Service command args
--constraint-add stringSlice Add or update a placement constraint --constraint-add list Add or update a placement constraint (default [])
--constraint-rm list Remove a constraint (default []) --constraint-rm list Remove a constraint (default [])
--container-label-add list Add or update a container label (default []) --container-label-add list Add or update a container label (default [])
--container-label-rm list Remove a container label by its key (default []) --container-label-rm list Remove a container label by its key (default [])
--dns-add list Add or update custom DNS servers (default []) --dns-add list Add or update custom DNS servers (default [])
--dns-options-add list Add or update DNS options (default []) --dns-options-add list Add or update DNS options (default [])
--dns-options-rm list Remove DNS options (default []) --dns-options-rm list Remove DNS options (default [])
--dns-rm list Remove custom DNS servers (default []) --dns-rm list Remove custom DNS servers (default [])
--dns-search-add list Add or update custom DNS search domains (default []) --dns-search-add list Add or update custom DNS search domains (default [])
--dns-search-rm list Remove DNS search domains (default []) --dns-search-rm list Remove DNS search domains (default [])
--endpoint-mode string Endpoint mode (vip or dnsrr) --endpoint-mode string Endpoint mode (vip or dnsrr)
--env-add list Add or update an environment variable (default []) --env-add list Add or update an environment variable (default [])
--env-rm list Remove an environment variable (default []) --env-rm list Remove an environment variable (default [])
--force Force update even if no changes require it --force Force update even if no changes require it
--group-add stringSlice Add an additional supplementary user group to the container --group-add list Add an additional supplementary user group to the container (default [])
--group-rm list Remove a previously added supplementary user group from the container (default []) --group-rm list Remove a previously added supplementary user group from the container (default [])
--health-cmd string Command to run to check health --health-cmd string Command to run to check health
--health-interval duration Time between running the check (ns|us|ms|s|m|h) (default 0s) --health-interval duration Time between running the check (default none)
--health-retries int Consecutive failures needed to report unhealthy --health-retries int Consecutive failures needed to report unhealthy
--health-timeout duration Maximum time to allow one check to run (ns|us|ms|s|m|h) (default 0s) --health-timeout duration Maximum time to allow one check to run (default none)
--help Print usage --help Print usage
--image string Service image tag --image string Service image tag
--label-add list Add or update a service label (default []) --label-add list Add or update a service label (default [])
--label-rm list Remove a label by its key (default []) --label-rm list Remove a label by its key (default [])
--limit-cpu NanoCPUs Limit CPUs (default 0.000) --limit-cpu decimal Limit CPUs (default 0.000)
--limit-memory MemoryBytes Limit Memory (default 0 B) --limit-memory bytes Limit Memory (default 0 B)
--log-driver string Logging driver for service --log-driver string Logging driver for service
--log-opt list Logging driver options (default []) --log-opt list Logging driver options (default [])
--mount-add mount Add or update a mount on a service --mount-add mount Add or update a mount on a service
--mount-rm list Remove a mount by its target path (default []) --mount-rm list Remove a mount by its target path (default [])
--no-healthcheck Disable any container-specified HEALTHCHECK --no-healthcheck Disable any container-specified HEALTHCHECK
--publish-add list Add or update a published port (default []) --publish-add list Add or update a published port (default [])
--publish-rm list Remove a published port by its target port (default []) --publish-rm list Remove a published port by its target port (default [])
--replicas uint64-ptr Number of tasks (default none) --replicas uint Number of tasks (default none)
--reserve-cpu NanoCPUs Reserve CPUs (default 0.000) --reserve-cpu decimal Reserve CPUs (default 0.000)
--reserve-memory MemoryBytes Reserve Memory (default 0 B) --reserve-memory bytes Reserve Memory (default 0 B)
--restart-condition string Restart when condition is met (none, on-failure, or any) --restart-condition string Restart when condition is met (none, on-failure, or any)
--restart-delay duration-ptr Delay between restart attempts (default none) --restart-delay duration Delay between restart attempts (default none)
--restart-max-attempts uint64-ptr Maximum number of restarts before giving up (default none) --restart-max-attempts uint Maximum number of restarts before giving up (default none)
--restart-window duration-ptr Window used to evaluate the restart policy (default none) --restart-window duration Window used to evaluate the restart policy (default none)
--rollback Rollback to previous specification --rollback Rollback to previous specification
--stop-grace-period duration-ptr Time to wait before force killing a container (default none) --stop-grace-period duration Time to wait before force killing a container (default none)
-t, --tty Allocate a pseudo-TTY -t, --tty Allocate a pseudo-TTY
--update-delay duration Delay between updates (ns|us|ms|s|m|h) (default 0s) --update-delay duration Delay between updates (ns|us|ms|s|m|h) (default 0s)
--update-failure-action string Action on update failure (pause|continue) (default "pause") --update-failure-action string Action on update failure (pause|continue) (default "pause")
--update-max-failure-ratio float32 Failure rate to tolerate during an update --update-max-failure-ratio float Failure rate to tolerate during an update
--update-monitor duration Duration after each task update to monitor for failure (ns|us|ms|s|m|h) (default 0s) --update-monitor duration Duration after each task update to monitor for failure (ns|us|ms|s|m|h) (default 0s)
--update-parallelism uint Maximum number of tasks updated simultaneously (0 to update all at once) (default 1) --update-parallelism uint Maximum number of tasks updated simultaneously (0 to update all at once) (default 1)
-u, --user string Username or UID (format: <name|uid>[:<group|gid>]) -u, --user string Username or UID (format: <name|uid>[:<group|gid>])
--with-registry-auth Send registry authentication details to swarm agents --with-registry-auth Send registry authentication details to swarm agents
-w, --workdir string Working directory inside the container -w, --workdir string Working directory inside the container
``` ```
Updates a service as described by the specified parameters. This command has to be run targeting a manager node. Updates a service as described by the specified parameters. This command has to be run targeting a manager node.