test: add root flags for tests

Adds a hidden --help flag (like in docker/cli) and a dummy -H flag

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
David Karlsson 2024-05-29 11:40:01 +02:00
Родитель 7142e86e9e
Коммит 7d56538a0d
16 изменённых файлов: 97 добавлений и 30 удалений

Просмотреть файл

@ -54,6 +54,11 @@ func setup() {
DisableFlagsInUseLine: true,
}
dockerCmd.PersistentFlags().BoolP("help", "h", false, "Print usage")
dockerCmd.PersistentFlags().MarkShorthandDeprecated("help", "please use --help")
dockerCmd.PersistentFlags().Lookup("help").Hidden = true
dockerCmd.Flags().StringP("host", "H", "unix:///var/run/docker.sock", "Daemon socket to connect to")
attachCmd = &cobra.Command{
Use: "attach [OPTIONS] CONTAINER",
Short: "Attach local standard input, output, and error streams to a running container",

Просмотреть файл

@ -21,10 +21,6 @@ Attach local standard input, output, and error streams to a running container
\fB--detach-keys\fP=""
Override the key sequence for detaching a container
.PP
\fB-h\fP, \fB--help\fP[=false]
help for attach
.PP
\fB--no-stdin\fP[=false]
Do not attach STDIN

Просмотреть файл

@ -49,10 +49,6 @@ Start a build
\fB-f\fP, \fB--file\fP=""
Name of the Dockerfile (default: "PATH/Dockerfile")
.PP
\fB-h\fP, \fB--help\fP[=false]
help for build
.PP
\fB--iidfile\fP=""
Write the image ID to the file

Просмотреть файл

@ -17,10 +17,6 @@ Proxy current stdio streams to builder instance
.SH OPTIONS
.PP
\fB-h\fP, \fB--help\fP[=false]
help for dial-stdio
.PP
\fB--platform\fP=""
Target platform: this is used for node selection

Просмотреть файл

@ -16,12 +16,6 @@ docker-buildx-install - Install buildx as a 'docker builder' alias
Install buildx as a 'docker builder' alias
.SH OPTIONS
.PP
\fB-h\fP, \fB--help\fP[=false]
help for install
.SH OPTIONS INHERITED FROM PARENT COMMANDS
.PP
\fB--builder\fP=""

Просмотреть файл

@ -16,12 +16,6 @@ docker-buildx-stop - Stop builder instance
Stop builder instance
.SH OPTIONS
.PP
\fB-h\fP, \fB--help\fP[=false]
help for stop
.SH OPTIONS INHERITED FROM PARENT COMMANDS
.PP
\fB--builder\fP=""

Просмотреть файл

@ -21,10 +21,6 @@ Extended build capabilities with BuildKit
\fB--builder\fP=""
Override the configured builder instance
.PP
\fB-h\fP, \fB--help\fP[=false]
help for buildx
.SH SEE ALSO
.PP

Просмотреть файл

@ -18,8 +18,8 @@ A self-sufficient runtime for containers
.SH OPTIONS
.PP
\fB-h\fP, \fB--help\fP[=false]
help for docker
\fB-H\fP, \fB--host\fP="unix:///var/run/docker.sock"
Daemon socket to connect to
.SH SEE ALSO

Просмотреть файл

@ -11,6 +11,12 @@ A self-sufficient runtime for containers
| [`buildx`](buildx.md) | Docker Buildx |
### Options
| Name | Type | Default | Description |
|:---------------|:---------|:------------------------------|:----------------------------|
| `-H`, `--host` | `string` | `unix:///var/run/docker.sock` | Daemon socket to connect to |
<!---MARKER_GEN_END-->

Просмотреть файл

@ -8,6 +8,28 @@ cname:
clink:
- docker_attach.yaml
- docker_buildx.yaml
options:
- option: help
value_type: bool
default_value: "false"
description: Print usage
deprecated: false
hidden: true
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
- option: host
shorthand: H
value_type: string
default_value: unix:///var/run/docker.sock
description: Daemon socket to connect to
deprecated: false
hidden: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
deprecated: false
hidden: false
experimental: false

Просмотреть файл

@ -37,6 +37,17 @@ options:
experimentalcli: false
kubernetes: false
swarm: false
inherited_options:
- option: help
value_type: bool
default_value: "false"
description: Print usage
deprecated: false
hidden: true
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
deprecated: false
hidden: false
experimental: false

Просмотреть файл

@ -21,6 +21,17 @@ options:
experimentalcli: false
kubernetes: false
swarm: false
inherited_options:
- option: help
value_type: bool
default_value: "false"
description: Print usage
deprecated: false
hidden: true
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
deprecated: false
hidden: false
experimental: false

Просмотреть файл

@ -374,6 +374,16 @@ inherited_options:
experimentalcli: false
kubernetes: false
swarm: false
- option: help
value_type: bool
default_value: "false"
description: Print usage
deprecated: false
hidden: true
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
deprecated: false
hidden: false
experimental: false

Просмотреть файл

@ -34,6 +34,16 @@ inherited_options:
experimentalcli: false
kubernetes: false
swarm: false
- option: help
value_type: bool
default_value: "false"
description: Print usage
deprecated: false
hidden: true
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
deprecated: false
hidden: false
experimental: false

Просмотреть файл

@ -14,6 +14,16 @@ inherited_options:
experimentalcli: false
kubernetes: false
swarm: false
- option: help
value_type: bool
default_value: "false"
description: Print usage
deprecated: false
hidden: true
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
deprecated: false
hidden: true
experimental: false

Просмотреть файл

@ -14,6 +14,16 @@ inherited_options:
experimentalcli: false
kubernetes: false
swarm: false
- option: help
value_type: bool
default_value: "false"
description: Print usage
deprecated: false
hidden: true
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
deprecated: false
hidden: false
experimental: false