Skip to content
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

Add -d as short command for --max-depth #2644

Closed
wants to merge 1 commit into from

Conversation

3tilley
Copy link

@3tilley 3tilley commented Nov 2, 2023

I've given a go to #2643, partly just as an experiment into how easy it would be - the answer was pretty easy with the tools available.

I've not:

  • Updated much documentation. The help is generated automatically, and I followed the model of --max-count / -m while making this change, where it's exclusively referred to by the long name
  • Added or updated any tests - I couldn't see that the --max-depth functionality is tested anywhere, so I didn't see anywhere to add or tweak for the short form. I can add some if you would like

I have given my best go at updating the zsh completions, but I'd be lying if I said I understood exactly how it worked. I've followed the example of --max-count and --max-columns, but I'd appreciate your eye to make sure it's been implemented correctly.

I've also tested locally, and it seems to work the same as --max-depth does:

$./target/debug/rg.exe glue --max-depth 4
$./target/debug/rg.exe glue -d 4
$./target/debug/rg.exe glue -d4
$./target/debug/rg.exe glue -d=4
$./target/debug/rg.exe glue --max-depth 5
crates\searcher\src\searcher\mod.rs
20:    searcher::glue::{MultiLine, ReadByLine, SliceByLine},
27:mod glue;
$./target/debug/rg.exe glue -d 5
crates\searcher\src\searcher\mod.rs
20:    searcher::glue::{MultiLine, ReadByLine, SliceByLine},
27:mod glue;
$./target/debug/rg.exe glue -d5
crates\searcher\src\searcher\mod.rs
20:    searcher::glue::{MultiLine, ReadByLine, SliceByLine},
27:mod glue;
$./target/debug/rg.exe glue -d=5
crates\searcher\src\searcher\mod.rs
20:    searcher::glue::{MultiLine, ReadByLine, SliceByLine},
27:mod glue;

If you agree with the premise of the change, let me know if there is anything I should update or check for.

Thanks!

@BurntSushi BurntSushi added the rollup A PR that has been merged with many others in a rollup. label Nov 21, 2023
BurntSushi added a commit that referenced this pull request Nov 21, 2023
Interestingly, ripgrep now only has two available ASCII letter short
flags remaining: -k and -y.

Closes #2643, Closes #2644
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR that has been merged with many others in a rollup.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants