diff options
author | Kalle Samuels <charles@derkarl.org> | 2018-04-27 09:37:53 +0000 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2018-07-21 16:26:39 -0400 |
commit | 1d09d4d31ba3ac2eb09edf31e8ec46b2b5cec388 (patch) | |
tree | f1f9696f5a37500d3b4ae0b6d6f452ab77a1d7b4 /src | |
parent | 02f08f3800611c214f8f51cd3bf8fcc9b24de331 (diff) |
ripgrep: add support for lz4 decompression
This uses the lz4 binary for decompression.
Closes #898
Diffstat (limited to 'src')
-rw-r--r-- | src/app.rs | 2 | ||||
-rw-r--r-- | src/decompressor.rs | 3 |
2 files changed, 4 insertions, 1 deletions
@@ -1445,7 +1445,7 @@ This flag can be used with the -o/--only-matching flag. fn flag_search_zip(args: &mut Vec<RGArg>) { const SHORT: &str = "Search in compressed files."; const LONG: &str = long!("\ -Search in compressed files. Currently gz, bz2, xz, and lzma files are +Search in compressed files. Currently gz, bz2, xz, lzma and lz4 files are supported. This option expects the decompression binaries to be available in your PATH. diff --git a/src/decompressor.rs b/src/decompressor.rs index a94948af..235849b7 100644 --- a/src/decompressor.rs +++ b/src/decompressor.rs @@ -44,6 +44,7 @@ lazy_static! { m.insert("gz", DecompressionCommand::new("gzip", ARGS)); m.insert("bz2", DecompressionCommand::new("bzip2", ARGS)); m.insert("xz", DecompressionCommand::new("xz", ARGS)); + m.insert("lz4", DecompressionCommand::new("lz4", ARGS)); const LZMA_ARGS: &[&str] = &["--format=lzma", "-d", "-c"]; m.insert("lzma", DecompressionCommand::new("xz", LZMA_ARGS)); @@ -55,6 +56,7 @@ lazy_static! { builder.add(Glob::new("*.gz").unwrap()); builder.add(Glob::new("*.bz2").unwrap()); builder.add(Glob::new("*.xz").unwrap()); + builder.add(Glob::new("*.lz4").unwrap()); builder.add(Glob::new("*.lzma").unwrap()); builder.build().unwrap() }; @@ -63,6 +65,7 @@ lazy_static! { builder.add(Glob::new("*.tar.gz").unwrap()); builder.add(Glob::new("*.tar.xz").unwrap()); builder.add(Glob::new("*.tar.bz2").unwrap()); + builder.add(Glob::new("*.tar.lz4").unwrap()); builder.add(Glob::new("*.tgz").unwrap()); builder.add(Glob::new("*.txz").unwrap()); builder.add(Glob::new("*.tbz2").unwrap()); |