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

Improve error reporting for bad arg/group/subcommand names #3140

Merged
merged 2 commits into from
Dec 10, 2021

Conversation

epage
Copy link
Member

@epage epage commented Dec 10, 2021

With 3.0, we panic if the user passed in a bad arg, group, or subcommand name. This makes the errors and backtraces more specific.

epage added 2 commits December 9, 2021 18:49
This is especially helpful for people transitioning off of `is_present`
being used for subcommands.

Fixes clap-rs#3139
This will make it faster for someone to figure out what is going on
without dropping down to `RUST_BACKTRRACE=1` by giving them the arg
*and* telling them which function *they* called was involved.
@epage epage merged commit ca48e22 into clap-rs:master Dec 10, 2021
@epage epage added the M-unreviewed Meta: Request for post-merge review. label Dec 10, 2021
@epage epage deleted the panic branch December 10, 2021 01:35
@pksunkara pksunkara removed the M-unreviewed Meta: Request for post-merge review. label Dec 10, 2021
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.

None yet

2 participants