-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Searching for strings that start with a dash is very difficult #215
Comments
This is a classic issue with all command line tools. There are two accepted work-arounds. The first one, which you found already, is to explicitly use AFAIK, these are widely spread work-arounds. I'm not sure there's much more that can be done, and the same issue afflicts |
I understand, however, I did expect Perhaps, we can enforce that the pattern follows
|
I don't think I feel like this is a well understood failure mode for CLI tools and ripgrep provides the work arounds that one would expect already. Perhaps there could be an example showing a work around in the docs? |
Dupe of #102 |
Thanks for the doc change! |
FYI - What I did to workaround these issues in my tool was encode the entire fixed string into Unicode code points ( |
@alejandro5042 Do you mean something like this? |
Note that in the next release ( |
I escape the plain-text because AFAIK that's the only way to search for exactly that text. Background: I built a wrapper script around I have a TODO to upgrade to rg 0.3.x and I'll run my tests to verify everything still works with this new argv parser. Thanks for your great utility! |
Great! The good news is that this will get fixed again in 0.3.2, which i can hopefully get out tomorrow or the day after. |
Create a file
test.txt
with the contents-1
. The only way you can search this is by a--regexp
/-e
search:Calling it without
-e
doesn't work:A
--fixed-strings
/-F
search doesn't work either. I expected this to work.Other strings that are affected by this: command-line options.
(@pakdev actually found this issue.)
The text was updated successfully, but these errors were encountered: