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
Num args #4613
Num args #4613
Conversation
Appreciate if help to solve Lint problem on commit . |
Its not clear to me what this PR is trying to accomplish or how its related to #4507. Besides clarifying in the PR, what would help is to have the first commit that adds a test that demonstrates the problem and then the second commit makes this change and adjusts the test to show the correct behavior. #4567 serves as an example of this pattern. |
The problem is The tests configured before for it but we add new condition on it . |
Something is still not quite clicking with that explanation. If this is not related to #4507 (which I am not seeing how this change would be), maybe we should start with an issue being created. The template has places for an example program, reproduction steps, and expected vs actual behavior. I think this would greatly help clarify the point you are trying to make. |
use clap::Parser;
#[derive(Clone, Debug, Parser)]
pub struct CliArgs {
#[arg(num_args = 1)]
multi: Vec<String>,
}
fn main() {
let CliArgs { multi } = CliArgs::parse();
dbg!(multi);
} Reference to #4507 , when we define by this PR , now it will check if it for example Can check this example with current commit and this PR . just test it . |
I'm sorry, you are right. I was doing too superficial of a read of the Issue and was assuming it was a different one. First, we need to decide if that issue is a bug or not. I'm not certain. The second step is deciding what to do. Solving this at the parser level is ignoring what the caller specified. This likely would change at the caller level but we were going with a fairly specific behavior that we got through combining |
Thanks |
@epage Please consider to look at this PR. |
@epage |
Fixed #4507
PR will check argument which allow to have one value on argument and check if it's render before and
pending
list is empty then evaluate the arguments .One tests fixes , which doesn't contain num_args on it too .