simonw / datasette-ripgrep

Web interface for searching your code using ripgrep, built as a Datasette plugin
https://ripgrep.datasette.io
Apache License 2.0
72 stars 1 forks source link

Use -e to avoid input being treated as a command-line switch #7

Closed gijsh closed 4 years ago

gijsh commented 4 years ago

I noticed that when you search for something that is a command line argument to ripgrep this will get interpreted.

For example searching for '-v' will cause ripgrep to interpret the -v as a command line switch and return the non matching lines instead of searching for the string -v.

Solution might be as easy as adding '-e' option before the search term in run_ripgrep to tell ripgrep to interpret the next argument as a pattern.

simonw commented 4 years ago

Oops! That's bad. Thanks for the -e suggestion.