Commit Graph

16 Commits

Author SHA1 Message Date
31fc695941 Hide [flags] in usage output
This patch hides the [flags] in the usage output of commands, using the
new `.DisableFlagsInUseLine` option, instead of the temporary workaround
added in 8e600e10f7

Before this change:

    docker run
    "docker run" requires at least 1 argument.
    See 'docker run --help'.

    Usage:  docker run [OPTIONS] IMAGE [COMMAND] [ARG...] [flags]

    Run a command in a new container

After this change:

    docker run
    "docker run" requires at least 1 argument.
    See 'docker run --help'.

    Usage:  docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

    Run a command in a new container

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 00d080269a
Component: cli
2018-05-19 02:51:55 +02:00
5e391186a8 Refactor content_trust cli/flags handling
Remove the global variable used. Allows easier unit testing.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 6e21829af4
Component: cli
2018-03-08 15:00:43 -05:00
dd73a093e4 Merge pull request #564 from thaJeztah/fix-yaml-examples
Fix leading characters being stripped from example sections in YAML
Upstream-commit: 847cc4bdc0
Component: cli
2018-02-16 11:22:24 -05:00
4db79d6583 golint: remove redundant ifs
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: d845b4d36a
Component: cli
2018-01-13 13:16:34 +01:00
3e7d4bee2e Fix docs YAML generation setting "kubernetes" for "swarm"
Due to a copy/paste error, commands annotated with "swarm"
were incorrectly setting the "kubernetes" property.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 6be06a3db2
Component: cli
2018-01-11 18:30:50 +01:00
3e3e540e8d Fix PR comments
- More strict on orchestrator flag
- Make orchestrator flag more explicit as experimental
- Add experimentalCLI annotation on kubernetes flags
- Better kubeconfig error message
- Prefix service name with stackname in ps and services stack subcommands
- Fix yaml documentation
- Fix code coverage ignoring generated code

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Upstream-commit: f1b116179f
Component: cli
2018-01-03 10:23:32 +01:00
7c4d9074f1 Fix UseLine
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 8e600e10f7
Component: cli
2017-10-25 18:22:04 -04:00
2e5b6e24c7 Update code for upstream cobra
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 4205416c9b
Component: cli
2017-10-25 14:49:26 -04:00
0f96be35a7 Add nakedret linter.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: dbd96badb6
Component: cli
2017-10-12 11:48:51 -04:00
6d1342e805 Fix leading characters being stripped from example sections in YAML
`strings.Trim()` strips any character listed in the `cutset` argument,
so any example section having `E`, `x`, `a`, `m`, `p`, `l`, `e`, or `s`
in the first word, had these characters missing in the generated
YAML.

Also trim superfluent whitespace characters to consistently use `|-` ("strip")
as block chomping indicator (see http://www.yaml.org/spec/1.2/spec.html#id2794534)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 1f605d43ca
Component: cli
2017-09-27 10:59:09 +02:00
f321e1ed9d Update gometalinter
The update includes bug fixes in gometalinter and updates to linters, which
discovered more linter problems.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: d956386b2d
Component: cli
2017-09-26 12:33:35 -04:00
150f7f6a55 Add more information about commands to generated YAML docs
This patch adds aditional information about commands to the YAML files
that are generated for the reference documentation.

The following fields are added for each command:

Property          | Type      | Description
------------------|-----------|---------------------------------------------------------------------------------------
deprecated        | Boolean   | Indicates if the command is marked deprecated
min_api_version   | String    | The API version required to use this command (e.g. "1.23")
experimental      | Boolean   | Indicates if the command requires the daemon to run with experimental features enabled

For example (taken from the experimental `docker checkpoint create` command):

    command: docker checkpoint create
    short: Create a checkpoint from a running container
    long: Create a checkpoint from a running container
    usage: docker checkpoint create [OPTIONS] CONTAINER CHECKPOINT
    pname: docker checkpoint
    plink: docker_checkpoint.yaml
    options:
    - option: checkpoint-dir
      value_type: string
      description: Use a custom checkpoint storage directory
      deprecated: false
      experimental: false
    - option: leave-running
      value_type: bool
      default_value: "false"
      description: Leave the container running after checkpoint
      deprecated: false
      experimental: false
    deprecated: false
    min_api_version: "1.25"
    experimental: true

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 1f48e75c5c
Component: cli
2017-09-14 00:48:22 +02:00
46def61677 Add more information about command flags to generated YAML docs
This patch adds aditional information about command flags to the YAML files
that are generated for the reference documentation.

The following fields are added for each flag:

Property          | Type      | Description
------------------|-----------|---------------------------------------------------------------------------------------
value_type        | String    | The "type" of value to be passed to this flag (e.g., `uint64`, `list`)
deprecated        | Boolean   | Indicates if the flag is marked deprecated
min_api_version   | String    | The API version required to use this flag (e.g. "1.23")
experimental      | Boolean   | Indicates if the flag requires the daemon to run with experimental features enabled

For example (taken from the `docker image build` command):

    - option: security-opt
      value_type: stringSlice
      default_value: '[]'
      description: Security options
      deprecated: false
      experimental: false
    - option: shm-size
      value_type: bytes
      default_value: "0"
      description: Size of /dev/shm
      deprecated: false
      experimental: false
    - option: squash
      value_type: bool
      default_value: "false"
      description: Squash newly built layers into a single new layer
      deprecated: false
      min_api_version: "1.25"
      experimental: true

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: a8ba6f93d9
Component: cli
2017-09-14 00:47:42 +02:00
003a07af7c Add unparam linter
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 3e3934c19f
Component: cli
2017-06-14 16:55:08 -07:00
ffaa61dd2d Add missing dependencies to vendor, and fix generation imports
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 875daf0130
Component: cli
2017-06-02 11:12:43 -04:00
7ff65f2f57 Revert docs/yaml removal
This reverts commit 3e911ff825.
Upstream-commit: d2cb97e76d
Component: cli
2017-06-02 00:25:19 +00:00