diff options
author | Wieland Hoffmann <themineo@gmail.com> | 2020-04-10 11:19:25 +0200 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2020-05-08 23:24:40 -0400 |
commit | df7a3bfc7fe30f3e9e89d8775748b1239c5b5fc4 (patch) | |
tree | a5ffa8a165feb657aebfc5bf8dde92f2be984fb3 /crates/cli/src/decompress.rs | |
parent | 28f2a93caefef8018c786c80c9b47f13f62c01c3 (diff) |
grep-cli: support files compressed by compress(1)
While Linux distributions (at least Arch Linux, RHEL, Debian) do not support
compressing files with compress(1), macOS & AIX do (the utility is part of
POSIX). Additionally, gzip is able to uncompress such compressed files and
provides an `uncompress` binary.
Closes #1547
Diffstat (limited to 'crates/cli/src/decompress.rs')
-rw-r--r-- | crates/cli/src/decompress.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crates/cli/src/decompress.rs b/crates/cli/src/decompress.rs index c2b2738b..94e118b1 100644 --- a/crates/cli/src/decompress.rs +++ b/crates/cli/src/decompress.rs @@ -348,6 +348,7 @@ fn default_decompression_commands() -> Vec<DecompressionCommand> { const ARGS_LZMA: &[&str] = &["xz", "--format=lzma", "-d", "-c"]; const ARGS_BROTLI: &[&str] = &["brotli", "-d", "-c"]; const ARGS_ZSTD: &[&str] = &["zstd", "-q", "-d", "-c"]; + const ARGS_UNCOMPRESS: &[&str] = &["uncompress", "-c"]; fn cmd(glob: &str, args: &[&str]) -> DecompressionCommand { DecompressionCommand { @@ -372,5 +373,6 @@ fn default_decompression_commands() -> Vec<DecompressionCommand> { cmd("*.br", ARGS_BROTLI), cmd("*.zst", ARGS_ZSTD), cmd("*.zstd", ARGS_ZSTD), + cmd("*.Z", ARGS_UNCOMPRESS), ] } |