-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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 -l / --files-with-matches option? #26
Comments
Does |
@BurntSushi at least my use case is generally |
That's reasonable. |
I was looking at adding it to |
@andschwa No worries! I might actually bang this out tonight. |
@BurntSushi Hey I just got it working! Let me get some tests and docs written and cleaned up, and I'll open a PR. |
@andschwa Oh you're quick, awesome, thank you! |
@BurntSushi Working, but not finished. Right now it operates almost exactly the same as It also should be just as easy to add I also think I could share a bit more logic with |
Tada: $ ./target/debug/rg -l files_with_matches
src/search_buffer.rs
src/search_stream.rs
src/args.rs |
Nice!
Absolutely, yes. This will probably need to go in both of the searchers, which means making them aware of this parameter as well. |
I'd be happy to do a review. The printer is due for a bit of refactoring, so don't feel too bad about it. |
Aye yai yai... figured out with |
Bah. How about we prefer compatibility with Maybe we can just drop the short hand for |
Closes BurntSushi#26. Acts like --count but emits only the paths of files with matches, suitable for piping to xargs. Both mmap and no-mmap searches terminate after the first match is found. Documentation updated and tests added.
Closes BurntSushi#26. Acts like --count but emits only the paths of files with matches, suitable for piping to xargs. Both mmap and no-mmap searches terminate after the first match is found. Documentation updated and tests added.
I use the
-l
option to grep / ack / ag / etc quite a lot to list files containing matches for further processing in a shell pipeline. Does it seem reasonable as a thing to add to ripgrep?The text was updated successfully, but these errors were encountered: