You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to get rid of the short help '-h' by removing default behaviour and creating own help argument with only long version using default functionality.
With using only #[arg(long, action = ArgAction::Help)] help is required.
Making the argument optional with default_value_t = false leads to panick.
Using help: Option<bool>, works and can be used as workaround.
These didn't make sense for the builder but are helpful for the derive.
The assert was assuming people wouldn't do this and to catch internal
problems.
Fixesclap-rs#4326
The assert is removed in 4.0.8. I've also considered adding support for () as a type to say "don't bother reading a value". If you are interested in that for this case, feel free to create an issue
Please complete the following tasks
Rust Version
rustc 1.64.0 (a55dd71d5 2022-09-19)
Clap Version
4.0.7
Minimal reproducible code
Steps to reproduce the bug with the above code
cargo run
Actual Behaviour
Expected Behaviour
No panick, no output.
Additional Context
I try to get rid of the short help '-h' by removing default behaviour and creating own help argument with only long version using default functionality.
With using only
#[arg(long, action = ArgAction::Help)]
help is required.Making the argument optional with
default_value_t = false
leads to panick.Using
help: Option<bool>,
works and can be used as workaround.Debug Output
The text was updated successfully, but these errors were encountered: