cli: add --stop-on-nonmatch flag

This causes ripgrep to stop searching an individual file after it has
found a non-matching line. But this only occurs after it has found a
matching line.

Fixes #1790, Closes #1930
This commit is contained in:
Edoardo Pirovano
2021-07-07 17:50:23 +01:00
committed by Andrew Gallant
parent 4782ebd5e0
commit 6d95c130d5
7 changed files with 99 additions and 12 deletions

View File

@@ -319,6 +319,7 @@ _rg() {
'(-q --quiet)'{-q,--quiet}'[suppress normal output]'
'--regex-size-limit=[specify upper size limit of compiled regex]:regex size (bytes)'
'*'{-u,--unrestricted}'[reduce level of "smart" searching]'
'--stop-on-nonmatch[stop on first non-matching line after a matching one]'
+ operand # Operands
'(--files --type-list file regexp)1: :_guard "^-*" pattern'