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
Using default_value_ifs
with required
returns error about argument not being provided when default is matched sometime after 3.1.12
#3838
Comments
default_value_ifs
with required
returns error about argument not being provided sometime after 3.1.12default_value_ifs
with required
returns error about argument not being provided when default is matched sometime after 3.1.12
That was broken with #3793 which was released in v3.2.0. This is a tricky one. This was not a documented or tested use case and in general our various validation rules should be for non-default arguments (we've been fine making similar changes across minor releases). We were also needing to allow On the other hand, this broke you. We'll need to do some investigation on this to see if there is a way to make both cases work. Otherwise we'll either need to
|
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Closing this as the new behavior is the expected behavior and the concern was with existing users which only means 3.x users. At this point, making a change to something like this would be too disruptive to |
@epage Deno actually relied on this behaviour ( |
Considering the existing behavior is the expected behavior, it would require v5 for us to break it. I also don't see us likely to change course on this which would require new validation logic. In general, I've been trying to hold off on new validation logic because there is a long tail of feature requests for it and would go counter to our build-time / binary size goals since it'd be all-or-nothing. Instead, I've been holding out for #3476 which will allow us and users to have more validation options without impacting build-time and binary size as much. Unfortunately, #3476 doesn't feel like enough of a priority atm for me to set aside the other stuff I'm doing to focus on it. |
Please complete the following tasks
Rust Version
1.61
Clap Version
3.2.5
Minimal reproducible code
Steps to reproduce the bug with the above code
cargo test default_ifs_arg_required_not_present
Actual Behaviour
error: The following required arguments were not provided:
Expected Behaviour
Should parse.
Additional Context
This error started occuring sometime after 3.1.12
Debug Output
No response
The text was updated successfully, but these errors were encountered: