-
-
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
--files-without-match reports an error when used with a single file path #1106
Comments
Please provide a fully reproducible example, which should include a corpus
to search.
…On Wed, Nov 14, 2018, 12:06 Maurice Gilden ***@***.*** wrote:
What version of ripgrep are you using?
ripgrep 0.10.0
-SIMD -AVX (compiled)
How did you install ripgrep?
cargo install ripgrep
What operating system are you using ripgrep on?
Windows 10
Describe your question, feature request, or bug.
I'm trying to get a list of files that contain one word, but not another
word. To do that I call "rg -l foo" to get a list of files that I pass on
to another call with "rg --files-without-match bar". The call looks
something like this: rg -l foo | xargs -i -d '\n' rg --files-without-match
bar {}
This doesn't work because --files-without-match cannot be used with a
single file. The error message is " output kind PathWithoutMatch requires a
file path". However I don't understand why that shouldn't be possible.
Maybe there's a better way to do this? If not I'd really appreciate it if
that could be implemented.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1106>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAb34tQF8B0lL928CvtUt5Dd-mdoTz3Nks5uvE16gaJpZM4YeL2C>
.
|
If you need an example, use the ripgrep source code with this (it lists all files with an impl block, but no tests): What I would like is to use rg for the second part as well, which probably would be: rg -l -g '*.rs' "impl " | xargs -i -d '\n' rg --files-without-match 'cfg\(test\)' {} My use case is searching in C++ code for includes that are not needed, e.g. rg -l "#include <vector>" | xargs -i -d '\n' grep -L "vector<" {} |
Thanks. As a suggestion, your Also,
This is definitely a bug. Thanks for reporting it! |
What version of ripgrep are you using?
ripgrep 0.10.0
-SIMD -AVX (compiled)
How did you install ripgrep?
cargo install ripgrep
What operating system are you using ripgrep on?
Windows 10
Describe your question, feature request, or bug.
I'm trying to get a list of files that contain one word, but not another word. To do that I call "rg -l foo" to get a list of files that I pass on to another call with "rg --files-without-match bar". The call looks something like this: rg -l foo | xargs -i -d '\n' rg --files-without-match bar {}
This doesn't work because --files-without-match cannot be used with a single file. The error message is " output kind PathWithoutMatch requires a file path". However I don't understand why that shouldn't be possible.
Maybe there's a better way to do this? If not I'd really appreciate it if that could be implemented.
The text was updated successfully, but these errors were encountered: