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 --- src/args.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/args.rs') diff --git a/src/args.rs b/src/args.rs index 56dacc97..030adf0f 100644 --- a/src/args.rs +++ b/src/args.rs @@ -77,6 +77,7 @@ pub struct Args { type_list: bool, types: Types, with_filename: bool, + search_zip_files: bool } impl Args { @@ -229,6 +230,7 @@ impl Args { .no_messages(self.no_messages) .quiet(self.quiet) .text(self.text) + .search_zip_files(self.search_zip_files) .build() } @@ -365,6 +367,7 @@ impl<'a> ArgMatches<'a> { type_list: self.is_present("type-list"), types: self.types()?, with_filename: with_filename, + search_zip_files: self.is_present("search-zip") }; if args.mmap { debug!("will try to use memory maps"); -- cgit v1.2.3