-
-
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 --files-without-matches flag. #239
Conversation
Performs the opposite of --files-with-matches: only shows paths of files that contain zero matches. Closes BurntSushi#138
@@ -1059,6 +1067,16 @@ sherlock!(feature_89_files_with_matches, "Sherlock", ".", | |||
}); | |||
|
|||
// See: https://github.com/BurntSushi/ripgrep/issues/89 | |||
sherlock!(feature_89_files_without_matches, "Sherlock", ".", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should say feature_138.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually meant issue #89, since the test is about the interaction between --null
and this feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see, missed that. Sounds good!
This looks awesome, thank you! I had one little nit but this otherwise looks good to go! |
Thanks! |
After playing with this, I realized that the equivalent option in grep is |
Done in 03f7605 |
Oops, my bad! Every other tool uses |
@mernen No worries, it's totally my fault since I didn't check grep either until just now! It's unfortunate that other tools diverge, but I tend to give grep the highest precedence with this sort of thing because of its ubiquity. I'm not too picky about the names in the code. There doesn't really need to be a precise correspondence between the CLI flags and the struct fields, so we can take liberties to make them more consistent. Moreover, much of that search code is going to get moved into a separate crate eventually, which will pretty firmly divorce it from whatever CLI interface ripgrep puts in front of it. |
Performs the opposite of
--files-with-matches
: only shows paths of files that contain zero matches.Closes #138.
This is a rather quick-and-dirty patch: I had zero familiarity with the codebase, and I basically searched for
files.with.matches
to guide me where changes should be made. I've tried to match the overall code style, but I may have missed something.