DockerCLI/cmd/docker
Hernan Garcia 2e01bdae1b prevent `tryRunPluginHelp()` execution on non-1st-level commands.
commands comes in the form of `rootCmd 1stCmd 2ndCmd` and the `tryRunPluginHelp()` function takes the command name to run plugin help in the form `docker-<command name>`, if command name matches a plugin name it will display the wrong help message.

to make sure we're using 1stCmd level we check if the root command is the same as the command parent.

e.g. `docker swarm init --help`
```
docker: is the root command
swarm : 1st level command
init  : 2nd level command
--help: is a flag
```

this approach is not taking in consideration if a plugin and 1st level command matches, for example `docker foo` command and `docker-foo` plugin.

Signed-off-by: Hernan Garcia <hernandanielg@gmail.com>
Signed-off-by: Hernan Garcia <hernan.garcia@percona.com>
2023-07-06 11:39:24 -05:00
..
winresources Use goversioninfo to create Windows Version Info 2021-10-11 16:54:22 +02:00
aliases.go build: set default context builder if not specified 2022-11-04 08:42:34 +01:00
builder.go Handle empty DOCKER_BUILDKIT like unset 2023-04-19 14:17:01 +02:00
builder_test.go cmd/docker: fix typo in deprecation warning 2022-12-19 13:03:28 +01:00
builder_windows_test.go build: set default context builder if not specified 2022-11-04 08:42:34 +01:00
completions.go Adopt Cobra completion v2 to support completion by CLI plugins 2022-05-12 12:59:10 +02:00
docker.go prevent `tryRunPluginHelp()` execution on non-1st-level commands. 2023-07-06 11:39:24 -05:00
docker_test.go Adopt Cobra completion v2 to support completion by CLI plugins 2022-05-12 12:59:10 +02:00
docker_windows_386.go remove pre-go1.17 build-tags 2023-05-05 18:23:03 +02:00
docker_windows_amd64.go remove pre-go1.17 build-tags 2023-05-05 18:23:03 +02:00
docker_windows_arm.go remove pre-go1.17 build-tags 2023-05-05 18:23:03 +02:00
docker_windows_arm64.go remove pre-go1.17 build-tags 2023-05-05 18:23:03 +02:00