From 58bdc366ec292653124699940190432ae30a6732 Mon Sep 17 00:00:00 2001 From: dana Date: Thu, 11 Jan 2018 17:45:51 -0600 Subject: 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 --- complete/_rg | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'complete') 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]' -- cgit v1.2.3