Description
A plugin can't use the same name as one of the cli global flags (debug, log-level, context, ...), or worse can't use the same shortcut (ex: -c).
If I add a new flag to the hello-world plugin like this following:
flags.StringVarP(&compose, "compose", "c", "", "compose file")
and try to use it:
$ docker helloworld -c my-compose-file.yml
unable to resolve docker endpoint: context "my-compose-file.yml" does not exist
$ docker --help
...
-c, --context string Name of the context to use to connect to the daemon (overrides DOCKER_HOST env var and default context set with "docker context use")
This context flag is a root command flag, not a PersistentFlag and so shouldn't be used by the docker cli and forwarded directly to the plugin.
Description
A plugin can't use the same name as one of the cli global flags (
debug,log-level,context, ...), or worse can't use the same shortcut (ex:-c).If I add a new flag to the
hello-worldplugin like this following:and try to use it:
This context flag is a root command flag, not a PersistentFlag and so shouldn't be used by the docker cli and forwarded directly to the plugin.