mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-07-26 01:31:57 -07:00
cli: make -d a short flag for --max-depth
Interestingly, ripgrep now only has two available ASCII letter short flags remaining: -k and -y. Closes #2643, Closes #2644
This commit is contained in:
@@ -3829,6 +3829,9 @@ impl Flag for MaxDepth {
|
||||
fn is_switch(&self) -> bool {
|
||||
false
|
||||
}
|
||||
fn name_short(&self) -> Option<u8> {
|
||||
Some(b'd')
|
||||
}
|
||||
fn name_long(&self) -> &'static str {
|
||||
"max-depth"
|
||||
}
|
||||
@@ -3873,6 +3876,9 @@ fn test_max_depth() {
|
||||
let args = parse_low_raw(["--max-depth", "5"]).unwrap();
|
||||
assert_eq!(Some(5), args.max_depth);
|
||||
|
||||
let args = parse_low_raw(["-d", "5"]).unwrap();
|
||||
assert_eq!(Some(5), args.max_depth);
|
||||
|
||||
let args = parse_low_raw(["--max-depth", "5", "--max-depth=10"]).unwrap();
|
||||
assert_eq!(Some(10), args.max_depth);
|
||||
|
||||
|
Reference in New Issue
Block a user