Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use HasAvailableFlags instead of HasFlags for Options in help #959

Merged
merged 1 commit into from
Mar 22, 2018

Conversation

vdemeester
Copy link
Collaborator

HasAvailableFlags checks if the command contains any flags (local
plus persistent from the entire structure) which are not hidden or
deprecated.

This fix the --help display when the Options is empty (but
showing), like on docker trust key

Before this change, it looks like that :

$ docker trust key --help
Usage:  docker trust key COMMAND

Manage keys for signing Docker images (experimental)

Options:


Commands:
  generate    Generate and load a signing key-pair
  load        Load a private key file for signing

Run 'docker trust key COMMAND --help' for more information on a command.

After

$ docker trust key --help

Usage:  docker trust key COMMAND

Manage keys for signing Docker images

Commands:
  generate    Generate and load a signing key-pair
  load        Load a private key file for signing

Run 'docker trust key COMMAND --help' for more information on a command.

🦁

Signed-off-by: Vincent Demeester [email protected]

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

> HasAvailableFlags checks if the command contains any flags (local
> plus persistent from the entire structure) which are not hidden or
> deprecated.

This fix the `--help` display when the `Options` is empty (but
showing), like on `docker trust key`

Signed-off-by: Vincent Demeester <[email protected]>
@vdemeester vdemeester force-pushed the help-use-available-flags branch from dc65597 to 66fdd08 Compare March 22, 2018 14:24
Copy link
Contributor

@dnephin dnephin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vdemeester vdemeester merged commit a6d2354 into docker:master Mar 22, 2018
@GordonTheTurtle GordonTheTurtle added this to the 18.04.0 milestone Mar 22, 2018
@vdemeester vdemeester deleted the help-use-available-flags branch March 22, 2018 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants