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

updates clap and removes home rolled -h/--help distinction #438

Merged
merged 1 commit into from
Apr 5, 2017

Conversation

kbknapp
Copy link
Contributor

@kbknapp kbknapp commented Apr 5, 2017

DO NOT MERGE - until clap v2.23.1 is on crates.io

It's safe to merge now.

  • crates.io needs to contain clap v2.23.1
  • I need to rebase the Cargo.lock

This commit updates clap to v2.23.1

The update contained a bug fix in clap that results in broken code in
ripgrep. ripgrep was unknowingly relying on the bug, but this commit fixes that
issue. The bug centered around not being able to override the
auto-generated help message by supplying a flag with a long of help.

Normally, supplying a flag with a long of help means whenever the user
passes --help, the consuming code (e.g. ripgrep) is responsible for
displaying the help message. However, due to the bug in clap this wasn't
necessary for ripgrep to do unless the user passed -h. With the bug
fixed, it meant the user passing --help and clap expected ripgrep to
display the help, yet ripgrep expected clap to display the help. This
has been fixed in this commit of ripgrep.

All is well now!

v2.23.0 also brings the abilty to use Arg::help or Arg::long_help
allowing one to distinguish between -h and --help. This commit
leaves all doc strings in the lazy_static! hashmap however only for
aesthetic reasons.

This means all home rolled handling of -h/--help has been removed
from ripgrep, yet functionality and appearances are 100% the same.

@BurntSushi
Copy link
Owner

Excellent! Thanks so much for doing this. I much appreciate the simpler case analysis. :-)

At some point, I'll get rid of the USAGES map and inline the docs, but I like that this PR doesn't do that. :-)

This commit updates clap to v2.23.0

The update contained a bug fix in clap that results in broken code in
ripgrep. ripgrep was relying on the bug, but this commit fixes that
issue. The bug centered around not being able to override the
auto-generated help message by supplying a flag with a long of `help`.

Normally, supplying a flag with a long of `help` means whenever the user
passes `--help`, the consuming code (e.g. ripgrep) is responsible for
displaying the help message. However, due to the bug in clap this wasn't
necessary for ripgrep to do unless the user passed `-h`. With the bug
fixed, it meant the user passing `--help` and clap expected ripgrep to
display the help, yet ripgrep expected clap to display the help. This
has been fixed in this commit of ripgrep.

All well now!

v2.23.0 also brings the abilty to use `Arg::help` or `Arg::long_help`
allowing one to distinguish between `-h` and `--help`. This commit
leaves all doc strings in the `lazy_static!` hashmap however only for
aesthetic reasons.

This means all home rolled handling of `-h`/`--help` has been removed
from ripgrep, yet functionality *and* appearances are 100% the same.
@kbknapp kbknapp changed the title updates clap and removes home rolled -h/--help distinction (DO NOT MERGE YET) updates clap and removes home rolled -h/--help distinction Apr 5, 2017
@BurntSushi BurntSushi merged commit 0c298f6 into BurntSushi:master Apr 5, 2017
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.

2 participants