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

Please omit "[FLAGS]" and "[ARGS]" from usage if not applicable #537

Closed
joshtriplett opened this issue Jun 23, 2016 · 4 comments
Closed
Labels
C-enhancement Category: Raise on the bar on expectations
Milestone

Comments

@joshtriplett
Copy link
Contributor

The automatically generated usage message includes placeholders for "[FLAGS]" and "[ARGS]", even when every flag or arg is already shown directly in the usage message. For instance, for the example in #533 (comment) , the usage string looks like this:

USAGE:
    rebase [FLAGS] <onto|--interactive> [ARGS]

However, this command doesn't take any flags other than --interactive (and --help), and doesn't take any args other than onto. So ideally the usage message should look like:

USAGE:
    rebase <onto|--interactive>
@kbknapp
Copy link
Member

kbknapp commented Jun 24, 2016

It's detecting --help or --version for "flags" but what I could do is omit the [FLAGS] if the only non-required args are --help or --version as I agree...it's not super useful to keep the flags tag there just for those two.

@kbknapp kbknapp added C-enhancement Category: Raise on the bar on expectations P4: nice to have labels Jun 24, 2016
@kbknapp kbknapp added this to the 2.7.0 milestone Jun 24, 2016
@joshtriplett
Copy link
Contributor Author

That sounds reasonable.

[ARGS] similarly shouldn't appear if all the arguments are required or otherwise part of a group that already displays them.

@kbknapp
Copy link
Member

kbknapp commented Jun 24, 2016

There was a recent commit that removes [ARGS] when it's only a single arg (required or not), but it currently doesn't do any determination as to whether or not all args are required, which makes sense to me so that's do-able.

@kbknapp
Copy link
Member

kbknapp commented Jun 24, 2016

This is now implemented in a local branch. Pushing the PR shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Raise on the bar on expectations
Projects
None yet
Development

No branches or pull requests

3 participants