I regressed this in d4ced2ef77 ("allow plugins to have argument which match a
top-level flag.") by unconditionally overwriting any `PersistentRunE` that the
user may have supplied.
We need to ensure two things:
1. That the user can use `PersistentRunE` (or `PersistentRun`) for their own
purposes.
2. That our initialisation always runs, even if the user has used
`PersistentRun*`, since that will shadow the root.
To do this add a `PersistentRunE` to the helloworld plugin which logs (covers 1
above) and then use it when calling the `apiversion` subcommand (which covers 2
since that uses the client)
Signed-off-by: Ian Campbell <ijc@docker.com>
18 lines
478 B
Plaintext
18 lines
478 B
Plaintext
|
|
Usage: docker helloworld [OPTIONS] COMMAND
|
|
|
|
A basic Hello World plugin for tests
|
|
|
|
Options:
|
|
-c, --context string Is it Christmas?
|
|
-D, --debug Enable debug
|
|
--pre-run Log from prerun hook
|
|
--who string Who are we addressing?
|
|
|
|
Commands:
|
|
apiversion Print the API version of the server
|
|
exitstatus2 Exit with status 2
|
|
goodbye Say Goodbye instead of Hello
|
|
|
|
Run 'docker helloworld COMMAND --help' for more information on a command.
|