Open ojab opened 2 years ago
Running docker info
returns the list of installed plugins. See below:
Client:
Context: default
Debug Mode: false
Plugins:
app: Docker App (Docker Inc., v0.9.1-beta3)
buildx: Docker Buildx (Docker Inc., v0.9.1-docker)
compose: Docker Compose (Docker Inc., v2.12.2)
scan: Docker Scan (Docker Inc., v0.17.0)
...
yeah, but IMHO --version
should still fail in this case, so we can easily check if plugin is installed without grepping.
Right and agree. I'm labelling as an enhancement. Thanks!
After looking into this, it seems to come from cobra's Command.Execute()
intended behaviour.
Which starts by handling --help
, then --version
, then the command's arguments (e.g. your asdasd
).
Docker CLI could manually check for invalid arguments before calling cobra's Command.Execute()
but that would defeat the purpose of relying on cobra, since we'd be reinventing the wheel on subcommand checks.
This is also (slightly?) related to;
There's a work-in-progress PR for that issue, but not sure if the fix is correct
Description
AFAIU it's impossible to check if plugin is installed/subcommand is available (
docker compose
, for example), becauseWithout
--version
flag it correctly reports that subcommand is not avaiable.Reproduce
docker asdasd --version
withoutasdasd
plugin installedDocker version 20.10.20, build 9fdeb9c
Expected behavior
docker version
docker info
Additional Info
No response