summaryrefslogtreecommitdiffstats
path: root/complete
diff options
context:
space:
mode:
authordana <dana@dana.is>2018-01-11 17:45:51 -0600
committerAndrew Gallant <jamslam@gmail.com>2018-01-11 18:45:51 -0500
commit58bdc366ec292653124699940190432ae30a6732 (patch)
treeb9f57e7d3502bf23452a0c0445edd593c628f402 /complete
parent34c0b1bc709f74678d7c1a24046c26571c25eaec (diff)
printer: add --passthru flag
The --passthru flag causes ripgrep to print every line, even if the line does not contain a match. This is a response to the common pattern of `^|foo` to match every line, while still highlighting things like `foo`. Fixes #740
Diffstat (limited to 'complete')
-rw-r--r--complete/_rg8
1 files changed, 5 insertions, 3 deletions
diff --git a/complete/_rg b/complete/_rg
index 93ab4ae8..8455c804 100644
--- a/complete/_rg
+++ b/complete/_rg
@@ -26,7 +26,7 @@ _rg() {
'--column[show column numbers]'
'(-A -B -C --after-context --before-context --context)'{-C+,--context=}'[specify lines to show before and after each match]:number of lines'
'--context-separator=[specify string used to separate non-continuous context lines in output]:separator'
- '(-c --count)'{-c,--count}'[only show count of matches for each file]'
+ '(-c --count --passthrough --passthru)'{-c,--count}'[only show count of matches for each file]'
'--debug[show debug messages]'
'--dfa-size-limit=[specify upper size limit of generated DFA]:DFA size'
'(-E --encoding)'{-E+,--encoding=}'[specify text encoding of files to search]: :_rg_encodings'
@@ -61,13 +61,15 @@ _rg() {
'--no-messages[suppress all error messages]'
"(--mmap --no-mmap)--no-mmap[don't search using memory maps]"
'(-0 --null)'{-0,--null}'[print NUL byte after file names]'
- '(-o --only-matching -r --replace)'{-o,--only-matching}'[show only matching part of each line]'
+ '(-o -r --only-matching --passthrough --passthru --replace)'{-o,--only-matching}'[show only matching part of each line]'
+ '(-c -o -r --count --only-matching --passthrough --replace)--passthru[show both matching and non-matching lines]'
+ '!(-c -o -r --count --only-matching --passthru --replace)--passthrough'
'--path-separator=[specify path separator to use when printing file names]:separator'
'(-p --heading --no-heading --pretty --vimgrep)'{-p,--pretty}'[alias for --color=always --heading -n]'
'(-q --quiet)'{-q,--quiet}'[suppress normal output]'
'--regex-size-limit=[specify upper size limit of compiled regex]:regex size'
'(1 -f --file)*'{-e+,--regexp=}'[specify pattern]:pattern'
- '(-o --only-matching -r --replace)'{-r+,--replace=}'[specify string used to replace matches]:replace string'
+ '(-c -o -r --count --only-matching --passthrough --passthru --replace)'{-r+,--replace=}'[specify string used to replace matches]:replace string'
'(-i -s -S --ignore-case --case-sensitive --smart-case)'{-S,--smart-case}'[search case-insensitively if the pattern is all lowercase]'
'(-j --threads)--sort-files[sort results by file path (disables parallelism)]'
'(-a --text)'{-a,--text}'[search binary files as if they were text]'