From 38dba8084141a7594e48eccdfc0e16f6e3545955 Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Tue, 5 Dec 2023 01:01:34 +0000 Subject: [PATCH 1/3] Clarify that .sz refers to Google's Snappy format It needs to be disambiguated from the unfortunately named SZ compression, see https://szcompressor.org/. Fixes #563 --- README.md | 2 +- src/cli/args.rs | 2 +- tests/snapshots/ui__ui_test_usage_help_flag.snap | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 64fa6bd59..97ca02524 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,7 @@ Output: # Supported formats -| Format | `.tar` | `.zip` | `.gz` | `.xz`, `.lzma` | `.bz`, `.bz2` | `.lz4` | `.sz` | `.zst` | +| Format | `.tar` | `.zip` | `.gz` | `.xz`, `.lzma` | `.bz`, `.bz2` | `.lz4` | `.sz` (Snappy) | `.zst` | |:---------:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| | Supported | ✓ | ✓¹ | ✓² | ✓ | ✓ | ✓ | ✓² | ✓ | diff --git a/src/cli/args.rs b/src/cli/args.rs index 3a6c32dae..4b724f02c 100644 --- a/src/cli/args.rs +++ b/src/cli/args.rs @@ -5,7 +5,7 @@ use clap::{Parser, ValueHint}; // Ouch command line options (docstrings below are part of --help) /// A command-line utility for easily compressing and decompressing files and directories. /// -/// Supported formats: tar, zip, gz, xz/lzma, bz/bz2, lz4, sz, zst. +/// Supported formats: tar, zip, gz, xz/lzma, bz/bz2, lz4, sz (Snappy), zst. /// /// Repository: https://github.com/ouch-org/ouch #[derive(Parser, Debug, PartialEq)] diff --git a/tests/snapshots/ui__ui_test_usage_help_flag.snap b/tests/snapshots/ui__ui_test_usage_help_flag.snap index 71d60084b..ccb2c6f1d 100644 --- a/tests/snapshots/ui__ui_test_usage_help_flag.snap +++ b/tests/snapshots/ui__ui_test_usage_help_flag.snap @@ -4,7 +4,7 @@ expression: "output_to_string(ouch!(\"--help\"))" --- A command-line utility for easily compressing and decompressing files and directories. -Supported formats: tar, zip, gz, xz/lzma, bz/bz2, lz4, sz, zst. +Supported formats: tar, zip, gz, xz/lzma, bz/bz2, lz4, sz (Snappy), zst. Repository: https://github.com/ouch-org/ouch From df061f1a80d17dfff43abaaff7480fdc3cb1915d Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Mon, 4 Dec 2023 17:08:33 -0800 Subject: [PATCH 2/3] Mention 7z support in README and help --- README.md | 6 +++--- src/cli/args.rs | 2 +- tests/snapshots/ui__ui_test_usage_help_flag.snap | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 97ca02524..ba5ff3e4b 100644 --- a/README.md +++ b/README.md @@ -111,9 +111,9 @@ Output: # Supported formats -| Format | `.tar` | `.zip` | `.gz` | `.xz`, `.lzma` | `.bz`, `.bz2` | `.lz4` | `.sz` (Snappy) | `.zst` | -|:---------:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| -| Supported | ✓ | ✓¹ | ✓² | ✓ | ✓ | ✓ | ✓² | ✓ | +| Format | `.tar` | `.zip` | `7z` | `.gz` | `.xz`, `.lzma` | `.bz`, `.bz2` | `.lz4` | `.sz` (Snappy) | `.zst` | +|:---------:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| +| Supported | ✓ | ✓¹ | ✓ | ✓² | ✓ | ✓ | ✓ | ✓² | ✓ | ✓: Supports compression and decompression. diff --git a/src/cli/args.rs b/src/cli/args.rs index 4b724f02c..ca02e9d61 100644 --- a/src/cli/args.rs +++ b/src/cli/args.rs @@ -5,7 +5,7 @@ use clap::{Parser, ValueHint}; // Ouch command line options (docstrings below are part of --help) /// A command-line utility for easily compressing and decompressing files and directories. /// -/// Supported formats: tar, zip, gz, xz/lzma, bz/bz2, lz4, sz (Snappy), zst. +/// Supported formats: tar, zip, gz, 7z, xz/lzma, bz/bz2, lz4, sz (Snappy), zst. /// /// Repository: https://github.com/ouch-org/ouch #[derive(Parser, Debug, PartialEq)] diff --git a/tests/snapshots/ui__ui_test_usage_help_flag.snap b/tests/snapshots/ui__ui_test_usage_help_flag.snap index ccb2c6f1d..4032a2101 100644 --- a/tests/snapshots/ui__ui_test_usage_help_flag.snap +++ b/tests/snapshots/ui__ui_test_usage_help_flag.snap @@ -4,7 +4,7 @@ expression: "output_to_string(ouch!(\"--help\"))" --- A command-line utility for easily compressing and decompressing files and directories. -Supported formats: tar, zip, gz, xz/lzma, bz/bz2, lz4, sz (Snappy), zst. +Supported formats: tar, zip, gz, 7z, xz/lzma, bz/bz2, lz4, sz (Snappy), zst. Repository: https://github.com/ouch-org/ouch From a3ce5ebad3d3040d28c11aff8c1a8358bf0585b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marcos=20P=2E=20Bezerra?= Date: Tue, 5 Dec 2023 12:52:52 -0300 Subject: [PATCH 3/3] Mention Rar support in README and help --- README.md | 17 +++++++++-------- src/cli/args.rs | 2 +- .../snapshots/ui__ui_test_usage_help_flag.snap | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index ba5ff3e4b..c96909d8b 100644 --- a/README.md +++ b/README.md @@ -111,25 +111,26 @@ Output: # Supported formats -| Format | `.tar` | `.zip` | `7z` | `.gz` | `.xz`, `.lzma` | `.bz`, `.bz2` | `.lz4` | `.sz` (Snappy) | `.zst` | -|:---------:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| -| Supported | ✓ | ✓¹ | ✓ | ✓² | ✓ | ✓ | ✓ | ✓² | ✓ | +| Format | `.tar` | `.zip` | `7z` | `.gz` | `.xz`, `.lzma` | `.bz`, `.bz2` | `.lz4` | `.sz` (Snappy) | `.zst` | `.rar` | +|:---------:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| +| Supported | ✓ | ✓¹ | ✓¹ | ✓² | ✓ | ✓ | ✓ | ✓² | ✓ | ✓³ | ✓: Supports compression and decompression. -✓¹: Due to limitations of `.zip`, it doesn't support streaming (de)compression. +✓¹: Due to limitations of the compression format itself, (de)compression can't be done with streaming. ✓²: Supported, and compression runs in parallel. +✓³: Due to Rar's restrictive license, only decompression and listing can be supported. + `tar` aliases are also supported: `tgz`, `tbz`, `tbz2`, `tlz4`, `txz`, `tlzma`, `tsz`, `tzst`. Formats can be chained: -- `.zst.gz` -- `.tar.gz.gz` -- `.tar.gz.gz.gz.zst.xz.bz.lz4` +- `.tar.gz` +- `.tar.gz.xz.zst.gz.lz4.sz` -If the filename has no extensions, `Ouch` will try to infer the format by the [file signature](https://en.wikipedia.org/wiki/List_of_file_signatures). +If the filename has no extensions, `Ouch` will try to infer the format by the [file signature](https://en.wikipedia.org/wiki/List_of_file_signatures) and ask the user for confirmation. # Installation diff --git a/src/cli/args.rs b/src/cli/args.rs index ca02e9d61..85712a48d 100644 --- a/src/cli/args.rs +++ b/src/cli/args.rs @@ -5,7 +5,7 @@ use clap::{Parser, ValueHint}; // Ouch command line options (docstrings below are part of --help) /// A command-line utility for easily compressing and decompressing files and directories. /// -/// Supported formats: tar, zip, gz, 7z, xz/lzma, bz/bz2, lz4, sz (Snappy), zst. +/// Supported formats: tar, zip, gz, 7z, xz/lzma, bz/bz2, lz4, sz (Snappy), zst and rar. /// /// Repository: https://github.com/ouch-org/ouch #[derive(Parser, Debug, PartialEq)] diff --git a/tests/snapshots/ui__ui_test_usage_help_flag.snap b/tests/snapshots/ui__ui_test_usage_help_flag.snap index 4032a2101..7cf21d211 100644 --- a/tests/snapshots/ui__ui_test_usage_help_flag.snap +++ b/tests/snapshots/ui__ui_test_usage_help_flag.snap @@ -4,7 +4,7 @@ expression: "output_to_string(ouch!(\"--help\"))" --- A command-line utility for easily compressing and decompressing files and directories. -Supported formats: tar, zip, gz, 7z, xz/lzma, bz/bz2, lz4, sz (Snappy), zst. +Supported formats: tar, zip, gz, 7z, xz/lzma, bz/bz2, lz4, sz (Snappy), zst and rar. Repository: https://github.com/ouch-org/ouch