-
-
Notifications
You must be signed in to change notification settings - Fork 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
"Could not downcast" from ArgAction::Count
#4417
Comments
Confirming the bug in the case of Trying to run it with
|
Maybe I got confused but I remember being very puzzled when it was working for me without |
@ssokolow : Could you please change the title of this issue and remove flamegraph from it, for the issue you are reporint is broader than that. |
ArgAction::Count
when run under cargo flamegraph
ArgAction::Count
Right now, v3 is in maintenance mode and will receive security updates. Even v2 is deprecated, but not obsolete, and we'll still try to resolve showstoppers if they come up. |
The error message is better under debug builds than release builds. This error is expected behavior and I would be more surprised by this working than not. As this error is expected, I'm going to go ahead and close this. If there is something I was missing in closing this, let us know!. |
I thought that might be the case. Could I reopen and rebadge this to be about how fish-to-the-face-ishly surprising and frustratingly confusing it is for a Rust library to giving me an error message I'd expect out of urwid? ...especially when the error message doesn't say "Try again with a debug build, man." (Urwid is kind of infamous for how it leans on Python's duck-typing in the worst possible way and, if you don't get the declarative UI definitons exactly in line with the schema it expects, your program dies with an |
Actually, now that I think about it, I wonder if the debug/release difference is why, with 3.x, I remember getting a successful run with |
Please complete the following tasks
Rust Version
rustc 1.64.0 (a55dd71d5 2022-09-19)
Clap Version
3.2.22 and 4.0.18, though output is from 3.2.22
Minimal reproducible code
...with
clap = { version = "3", features = ["derive"] }
Steps to reproduce the bug with the above code
Actual Behaviour
Expected Behaviour
(Or an error that's not obviously clap's version of an ICE if that's not the correct way to do what I'm aiming for.)
Additional Context
Testing was with flamegraph v0.6.2 (the newest
cargo install
able version at the moment I'm writing this), in case that proves relevant to reproduction.While I've confirmed this is still a problem on clap 4.x, I specifically care about 3.x, because I've been using
@dependabot ignore this minor version
pending the return of proper coloured output.I find monochromatic
--help
output ugly and "colored" output using intensity and underline to be worse and I'm waiting for support for colored output to return. (TheNO_COLOR
environment variable exists for people who don't want color, as does the terminal's control panel to redefine the base 16-color palette if they have trouble with color contrast and readability.)(If a security vulnerability pops up, I guess I'll have to publish a little crate to construct a
help_template
for clap 4.x by querying terminfo and theNO_COLOR
environment variable and then hard-coding the escape codes for the colors from clap 3.x... assuming that thehelp_template
syntax is versatile enough to reproduce it. I didn't actually check that. If it's not, maybe I'll publish a patched fork of clap 4.x to crates.io for them to depend on so I don't have to maintain tons of different vendored copies as these projects start to get published.)Debug Output
The text was updated successfully, but these errors were encountered: