-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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 flag seems to be interpreting regex as a filename (or docs aren't completely clear?) #418
Comments
@elirnm The behavior you're seeing is correct.
Could you suggest something that would make documentation clearer? (Note the third variant above.) |
Hmm,
which isn't even correct because Exploring a bit, I get the output you gave when I enter |
That's... interesting. I was using an older version when I responded. It looks like ripgrep's argv parser changed behavior recently? cc @kbknapp |
Interesting. If so it'd be a bug. I'll investigate when I get home. Do you know which version of clap got compiled with it, or if the |
Ok I'll look into it and put out a fix, it would be a major regression to slip by all the tests! Thanks for the ping! |
I've got a PR in to fix this and have added a regression test to ensure it doesn't pop up. Once the PR merges i'll put out v2.22.1 |
The new version is out which fixes this regression |
The latest version of clap sadly does not fix this issue. ripgrep uses a template in addition to a custom usage, which I don't think is accounted for in the regression test in clap-rs/clap#916. See also #426 I'll see about fixing clap when I get chance. |
Template fix Fixes BurntSushi/ripgrep#426 and BurntSushi/ripgrep#418 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/kbknapp/clap-rs/921) <!-- Reviewable:end -->
Closed in #429 |
I'm on Windows 7, and running ripgrep with the --files flag seems to be treating my search regex as a filename and then throwing an error.
So
rg -w Bob
works properly and produces matches, butrg -w Bob --files
producesBob: The system cannot find the file specified. (os error 2)
and exits. If I run --files without the actual search term, it works and prints the files to be searched. This happens in both cmd.exe and Powershell.It occurs to me now that this might be expected behavior, since the search term shouldn't affect the output when rg is run with --files, but if so that should probably be documented in the help page and/or produce a more useful error. This seems implied by the synopsis in https://github.com/BurntSushi/ripgrep/blob/master/doc/rg.1.md, but that doesn't appear in the command line --help output and doesn't appear in the documentation for the --files flag.
Thanks for the great work on ripgrep.
The text was updated successfully, but these errors were encountered: