Ripgrep: Inconsistent behaviour for --invert-match

Created on 15 Apr 2018  路  3Comments  路  Source: BurntSushi/ripgrep

What version of ripgrep are you using?

ripgrep 0.8.1

What operating system are you using ripgrep on?

macOS High Sierra

Bug

This command detects multiple -v params:

$ rg -ve foo -ve bar /dev/null
error: The argument '--invert-match' was provided more than once, but cannot be used multiple times

This doesn't:

$ rg -ve foo -v -e bar /dev/null

Also this one:

$ rg -v -e foo --invert-match --invert-match -e bar /dev/null

I'm not sure what should be the expected behaviour, but I think it's not consistent.

bug

Most helpful comment

Thanks for the ping! I'll look into it soon, it appears that it'll be a super easy fix.

All 3 comments

This looks like a clap bug. The expected behavior is for multiple -v flags to be allowed, but it looks like you found a case where clap doesn't permit it, even though AppSettings::AllArgsOverrideSelf is set.

cc @kbknapp (super low priority bug)

Thanks for the ping! I'll look into it soon, it appears that it'll be a super easy fix.

@kbknapp Should I create an issue on clap's repo for this or does one already exist?

Was this page helpful?
0 / 5 - 0 ratings