We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
use clap::{Arg, App, AppSettings}; fn main() { let schema = App::new("ripgrep#1701 reproducer") .setting(AppSettings::AllArgsOverrideSelf) .arg(Arg::with_name("pretty") .short("p") .long("pretty")) .arg(Arg::with_name("search_zip") .short("z") .long("search-zip")); let test_args = &[ vec!["reproducer", "-pz", "-p"], vec!["reproducer", "-pzp"], vec!["reproducer", "-zpp"], vec!["reproducer", "-pp", "-z"], vec!["reproducer", "-p", "-p", "-z"], vec!["reproducer", "-p", "-pz"], vec!["reproducer", "-ppz"], ]; for argv in test_args { let matches = schema.clone().get_matches_from_safe(argv); match matches { Ok(_) => println!(" OK: {:?}", argv), Err(e) => println!("ERR: {:?} ({:?})", argv, e.kind), } } }
cargo run
rustc 1.47.0 (18bf6b4f0 2020-10-07)
OK: ["reproducer", "-pz", "-p"] OK: ["reproducer", "-pzp"] OK: ["reproducer", "-zpp"] OK: ["reproducer", "-pp", "-z"] OK: ["reproducer", "-p", "-p", "-z"] ERR: ["reproducer", "-p", "-pz"] (UnexpectedMultipleUsage) ERR: ["reproducer", "-ppz"] (UnexpectedMultipleUsage)
I tripped over this when a script that invoked rg -pz errored out because I had --pretty in my ripgrep configuration file.
rg -pz
--pretty
All of the strings in the reproducer should behave identically.
debug.log
The text was updated successfully, but these errors were encountered:
Linked to #1374, should be fixed by #2297, add regress tests later.
Sorry, something went wrong.
Done.
@ldm0 Did this make it into a clap 2.x release? Or is it only fixed in clap 3.x?
Only in 3.x
Successfully merging a pull request may close this issue.
Make sure you completed the following tasks
Code
Steps to reproduce the issue
cargo run
for the reproducer scriptVersion
rustc 1.47.0 (18bf6b4f0 2020-10-07)
Actual Behavior Summary
I tripped over this when a script that invoked
rg -pz
errored out because I had--pretty
in my ripgrep configuration file.Expected Behavior Summary
All of the strings in the reproducer should behave identically.
Additional context
debug.log
The text was updated successfully, but these errors were encountered: