From f007f940c53a4818ead58f2fe2e0fac95cc3a40a Mon Sep 17 00:00:00 2001 From: Balaji Sivaraman Date: Sun, 7 Jan 2018 21:35:58 +0530 Subject: search: add support for searching compressed files This commit adds opt-in support for searching compressed files during recursive search. This behavior is only enabled when the `-z/--search-zip` flag is passed to ripgrep. When enabled, a limited set of common compression formats are recognized via file extension, and a new process is spawned to perform the decompression. ripgrep then searches the stdout of that spawned process. Closes #539 --- complete/_rg | 1 + 1 file changed, 1 insertion(+) (limited to 'complete') diff --git a/complete/_rg b/complete/_rg index 8455c804..6b62c169 100644 --- a/complete/_rg +++ b/complete/_rg @@ -87,6 +87,7 @@ _rg() { '(-w -x --line-regexp --word-regexp)'{-w,--word-regexp}'[only show matches surrounded by word boundaries]' '(-e -f --file --files --regexp --type-list)1: :_rg_pattern' '(--type-list)*:file:_files' + '(-z --search-zip)'{-z,--search-zip}'[search in compressed files]' ) [[ ${_RG_COMPLETE_LIST_ARGS:-} == (1|t*|y*) ]] && { -- cgit v1.2.3