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

fix(help): Clarify short vs long help #4159

Merged
merged 1 commit into from Aug 31, 2022
Merged

fix(help): Clarify short vs long help #4159

merged 1 commit into from Aug 31, 2022

Conversation

epage
Copy link
Member

@epage epage commented Aug 31, 2022

In reviewing CLIs for #4132, I found some were providing helps on -h
vs --help and figured that could be built directly into clap. I had
considered not making this hint automatic but I figured the overhead of
checking if long exists wouldn't be too bad. The code exists (no binary
size increase) and just a simple iteration is probably not too slow
compared to everything else.

If you use -h, you'll see

-h, --help Print help information (use `--help` for more detail)

If you use --help, you'll see

    -h, --help
            Print help information (use `-h` for a summary)

Fixes #1015

@epage epage mentioned this pull request Aug 31, 2022
In reviewing CLIs for clap-rs#4132, I found some were providing helps on `-h`
vs `--help` and figured that could be built directly into clap.  I had
considered not making this hint automatic but I figured the overhead of
checking if long exists wouldn't be too bad.  The code exists (no binary
size increase) and just a simple iteration is probably not too slow
compared to everything else.

Fixes clap-rs#1015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Short/long help distinction seems unclear to the end-user
1 participant