num_args = 2..
does not error with 0 args and error has incorrect wording with 1 arg
#5526
Closed
2 tasks done
Labels
C-bug
Category: Updating dependencies
Please complete the following tasks
Rust Version
rustc 1.78.0 (9b00956e5 2024-04-29)
Clap Version
4.5.6
Minimal reproducible code
Steps to reproduce the bug with the above code
Error when running
cargo run -- asdf
:Shouldn't it say either of the following?
error: 1 more value required by '[ARG] [ARG]...'; only 1 was provided
error: 2 values required by '[ARG] [ARG]...'; only 1 was provided
(my personal preference is for this one)Actual Behaviour
There are 2 issues:
2..
and user gives 0, it does not produce an error as it should because the minimum number of args is 2Expected Behaviour
2..
and user gives 0, it should produce an error saying that it requires 2 args and 0 were givenAdditional Context
Unsure root cause on this one... a quick search did not find it... but I imagine that somewhere it tests the len against the num_args range (?)
clap/clap_builder/src/error/format.rs
Line 340 in 2f645d3
should be:
remove the word "more"
Debug Output
The text was updated successfully, but these errors were encountered: