-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add an assert that all args added to groups exist #917
Comments
Thanks for reporting this! Was this run in debug mode or release? Because in 2.21 we switched to turning off several asserts in release mode only. So I'm curious if this issue would have been caught in one of those. I'll start checking out a fix for this either way though. |
The Actual Behavior Summary was in a release build (which is what I am in the habit of running). The Debug output was a debug build. I have four 1.* releases of I'm willing to do a bisect kind of thing to figure out exactly which release of |
Thanks! No need to do the bisect, I'm about 99% sure what caused the issue The part I'm more curious about is how the tests didn't catch this, so I'm interested to dig in once I get home 😉 |
@bruceadams it appears the issue is actually there are two args/groups that have been added to the group See the arg/group |
This could have been failing silently in older versions of clap. |
Ah! Good point. My arguments and subcommands are complex enough that I lose track of things. Yes. Fixing that mistake in my code avoid this crash. Nice! |
From my point-of-view, this issue can be closed 🎉 I'll leave it to you to decide if you want to close it now or keep it around. Thanks or you quick help! Debugging my code! |
I think the error message could be better, and I could have an assert in debug mode that ensures all args added to groups actually exist, so I'll leave this open for those changes.
|
Please use the following template to assist with creating an issue, and getting a speedy resolution. If an area is not aplicable, feel free to delete the area, or mark with
N/A
Rust Version
rustc 1.16.0 (30cf806ef 2017-03-10)
Affected Version of clap
clap v2.21.2
andclap v2.22.1
(I tried a
cargo update
in hopes of hitting an existing fix.)This works fine with
clap v2.20.5
Expected Behavior Summary
My code, https://github.com/bruceadams/wdscli, built using
clap v2.20.5
Actual Behavior Summary
My code (exactly the same as above) built using
clap v2.22.1
Steps to Reproduce the issue
Sample Code or Link to Sample Code
I have not attempted to narrow down a sample for this failure. The relevant part of my code is here: https://github.com/bruceadams/wdscli/blob/master/src/cli.rs
Debug output
The text was updated successfully, but these errors were encountered: