Skip to content

A leading dash (-) in the desired pattern causes ripgrep to think there is no pattern. #1676

Discussion options

You must be logged in to vote

From the man page (and the --help output):

That is, you want rg -h | rg -e -S. Alternatively, you can use the old Unix convention of --, where everything after it is always interpreted as a positional argument. e.g., rg -h | rg -- -S. Finally one other trick is to tweak the regex syntax to fool the arg parser: rg -h | rg '[-]S'.

grep has the same problems and the same work-arounds.

See also #1560, which is a duplicate of this issue.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by BurntSushi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1676 on September 02, 2020 14:31.