Search on drive letter directory with '--' option does not correctly parse commandline #1658
-
What version of ripgrep are you using?ripgrep 11.0.2 (rev 3de31f7) How did you install ripgrep?Windows binary release from release page github. What operating system are you using ripgrep on?Windows 10. Describe your bug.When given the cmdline argument '--' to indicate that the term to search for starts with a '-' it suddenly cannot search in top level drive directories of mounted/substed windows drives. I tested without '--' and a normal searchterm and then everything worked. Curious thing is, normal driveletters also print suspicious lines, but actually still have normal behaviour. What are the steps to reproduce the behavior?running any command like: What is the actual behavior?rg -- "-integer" -g {.cpp,.h} -i -F "D:\" --no-config --debug This will give you and then it will actually do the search (but without actually debugging information so any further output is useless as it isn't running under debug mode) If you do it on a top level mounted/substed drive (e.g. you run subst s: and then search on s:\), the search doesn't even happen, just these file not found errors and an immediate exit. To me it seems like there is some kind of parser error of the arguments. What is the expected behavior?It should just perform the search with the given commandline options. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
When filing bugs, it is always good to try to simplify your use case. In this example, your command has a whole bunch of attempted flags and arguments. Why not try something that tests the only thing that you think is going wrong? Like this:
What is the output of that command? And if that fails, then what does this do?
Please help me debug your problem. Please include the full output of the command. As for your other errors, they are expected. The So your original command should look like this:
Alternatively, you can use the
|
Beta Was this translation helpful? Give feedback.
-
Hi, I must have missed the -e flag, as that is apparently what I needed, instead of --. I didn't know this -- convention for unix tools so I guess I learned something today. Also, "driveletter:\" never works, but "driveletter:\\" does, although I am not sure whether that is really a bug or just convention in your tool. In any case, your -e suggestion fixes what I was trying to achieve, so as far as I am concerned this issue can be closed. |
Beta Was this translation helpful? Give feedback.
When filing bugs, it is always good to try to simplify your use case. In this example, your command has a whole bunch of attempted flags and arguments. Why not try something that tests the only thing that you think is going wrong? Like this:
What is the output of that command? And if that fails, then what does this do?
Please help me debug your problem. Please include the full output of the command.
As for your other errors, they are expected. The
--
is a common Unix convention indicating that all arguments following it are positional. In other words, once you type--
, you can't put any flags after it. That's the whole point, otherwise-integer
…