Commit 2e01bda
Hernan Garcia
prevent
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>tryRunPluginHelp() execution on non-1st-level commands.1 parent dc2eb3b commit 2e01bda
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
141 | 144 | | |
142 | 145 | | |
143 | 146 | | |
| |||
0 commit comments