diff --git a/CHANGELOG.md b/CHANGELOG.md index e47501eac..3062d1f86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,8 @@ Categories Used: - Merge folders in decompression [\#798](https://github.com/ouch-org/ouch/pull/798) ([tommady](https://github.com/tommady)) - Add `--no-smart-unpack` flag to decompression command to disable smart unpack [\#809](https://github.com/ouch-org/ouch/pull/809) ([talis-fb](https://github.com/talis-fb)) - Provide Nushell completions (packages still need to install them) [\#827](https://github.com/ouch-org/ouch/pull/827) ([FrancescElies](https://github.com/FrancescElies)) +- Support `.lz` decompression [\#838](https://github.com/ouch-org/ouch/pull/838) ([zzzsyyy](https://github.com/zzzsyyy)) +- Support `.lzma` decompression (and fix `.lzma` being a wrong alias for `.xz`) [\#838](https://github.com/ouch-org/ouch/pull/838) ([zzzsyyy](https://github.com/zzzsyyy)) ### Improvements diff --git a/Cargo.lock b/Cargo.lock index 71b8cf980..93dce30a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -926,6 +926,26 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "liblzma" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0791ab7e08ccc8e0ce893f6906eb2703ed8739d8e89b57c0714e71bad09024c8" +dependencies = [ + "liblzma-sys", +] + +[[package]] +name = "liblzma-sys" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01b9596486f6d60c3bbe644c0e1be1aa6ccc472ad630fe8927b456973d7cb736" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + [[package]] name = "libredox" version = "0.1.3" @@ -995,17 +1015,6 @@ dependencies = [ "byteorder", ] -[[package]] -name = "lzma-sys" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fda04ab3764e6cde78b9974eec4f779acaba7c4e84b36eca3cf77c581b85d27" -dependencies = [ - "cc", - "libc", - "pkg-config", -] - [[package]] name = "memchr" version = "2.7.4" @@ -1115,6 +1124,7 @@ dependencies = [ "is_executable", "itertools", "libc", + "liblzma", "linked-hash-map", "lz4_flex", "memchr", @@ -1134,7 +1144,6 @@ dependencies = [ "test-strategy", "time", "unrar", - "xz2", "zip", "zstd", ] @@ -2078,15 +2087,6 @@ dependencies = [ "rustix", ] -[[package]] -name = "xz2" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388c44dc09d76f1536602ead6d325eb532f5c122f17782bd57fb47baeeb767e2" -dependencies = [ - "lzma-sys", -] - [[package]] name = "yansi" version = "1.0.1" diff --git a/Cargo.toml b/Cargo.toml index 5d314933d..1fe15af25 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,7 +41,7 @@ tar = "0.4.42" tempfile = "3.10.1" time = { version = "0.3.36", default-features = false } unrar = { version = "0.5.7", optional = true } -xz2 = "0.1.7" +liblzma = "0.4" zip = { version = "0.6.6", default-features = false, features = [ "time", "aes-crypto", diff --git a/README.md b/README.md index ae3441466..50664e2d7 100644 --- a/README.md +++ b/README.md @@ -111,9 +111,9 @@ Output: # Supported formats -| Format | `.tar` | `.zip` | `7z` | `.gz` | `.xz`, `.lzma` | `.bz`, `.bz2` | `.bz3` | `.lz4` | `.sz` (Snappy) | `.zst` | `.rar` | `.br` | -|:---------:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| -| Supported | ✓ | ✓¹ | ✓¹ | ✓² | ✓ | ✓ | ✓ | ✓ | ✓² | ✓² | ✓³ | ✓ | +| Format | `.tar` | `.zip` | `7z` | `.gz` | `.xz` | `.lzma` | `.lz` | `.bz`, `.bz2` | `.bz3` | `.lz4` | `.sz` (Snappy) | `.zst` | `.rar` | `.br` | +|:---------:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| +| Supported | ✓ | ✓¹ | ✓¹ | ✓² | ✓ | ✓⁴ | ✓⁴ | ✓ | ✓ | ✓ | ✓² | ✓² | ✓³ | ✓ | ✓: Supports compression and decompression. @@ -122,10 +122,13 @@ Output: ✓²: Supported, and compression runs in parallel. ✓³: Due to RAR's restrictive license, only decompression and listing can be supported. + +✓⁴: Only decompression is supported, compression is not implemented yet. + If you wish to exclude non-free code from your build, you can disable RAR support by building without the `unrar` feature. -`tar` aliases are also supported: `tgz`, `tbz`, `tbz2`, `tlz4`, `txz`, `tlzma`, `tsz`, `tzst`. +`tar` aliases are also supported: `tgz`, `tbz`, `tbz2`, `tlz4`, `txz`, `tlzma`, `tsz`, `tzst`, `tlz`. Formats can be chained: diff --git a/src/cli/args.rs b/src/cli/args.rs index b28156c9d..b756df50b 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, bz3, lz4, sz (Snappy), zst, rar and br. +/// Supported formats: tar, zip, gz, 7z, xz, lzma, lzip, bz/bz2, bz3, lz4, sz (Snappy), zst, rar and br. /// /// Repository: https://github.com/ouch-org/ouch #[derive(Parser, Debug, PartialEq)] diff --git a/src/commands/compress.rs b/src/commands/compress.rs index 15880bdca..0e6233bdd 100644 --- a/src/commands/compress.rs +++ b/src/commands/compress.rs @@ -68,10 +68,20 @@ pub fn compress_files( ) } Lz4 => Box::new(lz4_flex::frame::FrameEncoder::new(encoder).auto_finish()), - Lzma => Box::new(xz2::write::XzEncoder::new( + Lzma => { + return Err(crate::Error::UnsupportedFormat { + reason: "LZMA1 compression is not supported in ouch, use .xz instead.".to_string(), + }) + } + Xz => Box::new(liblzma::write::XzEncoder::new( encoder, level.map_or(6, |l| (l as u32).clamp(0, 9)), )), + Lzip => { + return Err(crate::Error::UnsupportedFormat { + reason: "Lzip compression is not supported in ouch.".to_string(), + }) + } Snappy => Box::new( gzp::par::compress::ParCompress::::builder() .compression_level(gzp::par::compress::Compression::new( @@ -108,7 +118,7 @@ pub fn compress_files( } match first_format { - Gzip | Bzip | Bzip3 | Lz4 | Lzma | Snappy | Zstd | Brotli => { + Gzip | Bzip | Bzip3 | Lz4 | Lzma | Xz | Lzip | Snappy | Zstd | Brotli => { writer = chain_writer_encoder(&first_format, writer)?; let mut reader = fs::File::open(&files[0])?; diff --git a/src/commands/decompress.rs b/src/commands/decompress.rs index 780c3928e..f5dc71256 100644 --- a/src/commands/decompress.rs +++ b/src/commands/decompress.rs @@ -128,7 +128,15 @@ pub fn decompress_file(options: DecompressOptions) -> crate::Result<()> { Box::new(bzip3::read::Bz3Decoder::new(decoder)?) } Lz4 => Box::new(lz4_flex::frame::FrameDecoder::new(decoder)), - Lzma => Box::new(xz2::read::XzDecoder::new(decoder)), + Lzma => Box::new(liblzma::read::XzDecoder::new_stream( + decoder, + liblzma::stream::Stream::new_lzma_decoder(u64::MAX).unwrap(), + )), + Xz => Box::new(liblzma::read::XzDecoder::new(decoder)), + Lzip => Box::new(liblzma::read::XzDecoder::new_stream( + decoder, + liblzma::stream::Stream::new_lzip_decoder(u64::MAX, 0).unwrap(), + )), Snappy => Box::new(snap::read::FrameDecoder::new(decoder)), Zstd => Box::new(zstd::stream::Decoder::new(decoder)?), Brotli => Box::new(brotli::Decompressor::new(decoder, BUFFER_CAPACITY)), @@ -144,7 +152,7 @@ pub fn decompress_file(options: DecompressOptions) -> crate::Result<()> { } let files_unpacked = match first_extension { - Gzip | Bzip | Bzip3 | Lz4 | Lzma | Snappy | Zstd | Brotli => { + Gzip | Bzip | Bzip3 | Lz4 | Lzma | Xz | Lzip | Snappy | Zstd | Brotli => { reader = chain_reader_decoder(&first_extension, reader)?; let mut writer = match utils::ask_to_create_file( diff --git a/src/commands/list.rs b/src/commands/list.rs index 4a344a7a9..a2e7915a0 100644 --- a/src/commands/list.rs +++ b/src/commands/list.rs @@ -57,7 +57,15 @@ pub fn list_archive_contents( Box::new(bzip3::read::Bz3Decoder::new(decoder).unwrap()) } Lz4 => Box::new(lz4_flex::frame::FrameDecoder::new(decoder)), - Lzma => Box::new(xz2::read::XzDecoder::new(decoder)), + Lzma => Box::new(liblzma::read::XzDecoder::new_stream( + decoder, + liblzma::stream::Stream::new_lzma_decoder(u64::MAX).unwrap(), + )), + Xz => Box::new(liblzma::read::XzDecoder::new(decoder)), + Lzip => Box::new(liblzma::read::XzDecoder::new_stream( + decoder, + liblzma::stream::Stream::new_lzip_decoder(u64::MAX, 0).unwrap(), + )), Snappy => Box::new(snap::read::FrameDecoder::new(decoder)), Zstd => Box::new(zstd::stream::Decoder::new(decoder)?), Brotli => Box::new(brotli::Decompressor::new(decoder, BUFFER_CAPACITY)), @@ -127,7 +135,7 @@ pub fn list_archive_contents( Box::new(archive::sevenz::list_archive(io::Cursor::new(vec), password)?) } - Gzip | Bzip | Bzip3 | Lz4 | Lzma | Snappy | Zstd | Brotli => { + Gzip | Bzip | Bzip3 | Lz4 | Lzma | Xz | Lzip | Snappy | Zstd | Brotli => { unreachable!("Not an archive, should be validated before calling this function."); } }; diff --git a/src/error.rs b/src/error.rs index 167bc7b97..6e607ab3a 100644 --- a/src/error.rs +++ b/src/error.rs @@ -135,8 +135,8 @@ impl FinalError { /// /// This is what it looks like: /// ``` - /// hint: Supported extensions are: tar, zip, bz, bz2, gz, lz4, xz, lzma, sz, zst - /// hint: Supported aliases are: tgz, tbz, tlz4, txz, tzlma, tsz, tzst + /// hint: Supported extensions are: tar, zip, bz, bz2, gz, lz4, xz, lzma, lz, sz, zst + /// hint: Supported aliases are: tgz, tbz, tlz4, txz, tlzma, tsz, tzst, tlz /// ``` pub fn hint_all_supported_formats(self) -> Self { self.hint(format!("Supported extensions are: {PRETTY_SUPPORTED_EXTENSIONS}")) diff --git a/src/extension.rs b/src/extension.rs index e886634c6..c6935f41a 100644 --- a/src/extension.rs +++ b/src/extension.rs @@ -19,6 +19,7 @@ pub const SUPPORTED_EXTENSIONS: &[&str] = &[ "lz4", "xz", "lzma", + "lz", "sz", "zst", #[cfg(feature = "unrar")] @@ -27,14 +28,14 @@ pub const SUPPORTED_EXTENSIONS: &[&str] = &[ "br", ]; -pub const SUPPORTED_ALIASES: &[&str] = &["tgz", "tbz", "tlz4", "txz", "tzlma", "tsz", "tzst"]; +pub const SUPPORTED_ALIASES: &[&str] = &["tgz", "tbz", "tlz4", "txz", "tlzma", "tsz", "tzst", "tlz"]; #[cfg(not(feature = "unrar"))] -pub const PRETTY_SUPPORTED_EXTENSIONS: &str = "tar, zip, bz, bz2, bz3, gz, lz4, xz, lzma, sz, zst, 7z"; +pub const PRETTY_SUPPORTED_EXTENSIONS: &str = "tar, zip, bz, bz2, bz3, gz, lz4, xz, lzma, lz, sz, zst, 7z"; #[cfg(feature = "unrar")] -pub const PRETTY_SUPPORTED_EXTENSIONS: &str = "tar, zip, bz, bz2, bz3, gz, lz4, xz, lzma, sz, zst, rar, 7z"; +pub const PRETTY_SUPPORTED_EXTENSIONS: &str = "tar, zip, bz, bz2, bz3, gz, lz4, xz, lzma, lz, sz, zst, rar, 7z"; -pub const PRETTY_SUPPORTED_ALIASES: &str = "tgz, tbz, tlz4, txz, tzlma, tsz, tzst"; +pub const PRETTY_SUPPORTED_ALIASES: &str = "tgz, tbz, tlz4, txz, tlzma, tsz, tzst, tlz"; /// A wrapper around `CompressionFormat` that allows combinations like `tgz` #[derive(Debug, Clone)] @@ -85,8 +86,12 @@ pub enum CompressionFormat { Bzip3, /// .lz4 Lz4, - /// .xz .lzma + /// .xz + Xz, + /// .lzma Lzma, + /// .lzip + Lzip, /// .sz Snappy, /// tar, tgz, tbz, tbz2, tbz3, txz, tlz4, tlzma, tsz, tzst @@ -95,7 +100,6 @@ pub enum CompressionFormat { Zstd, /// .zip Zip, - // even if built without RAR support, we still want to recognise the format /// .rar Rar, /// .7z @@ -105,19 +109,11 @@ pub enum CompressionFormat { } impl CompressionFormat { - /// Currently supported archive formats are .tar (and aliases to it) and .zip pub fn archive_format(&self) -> bool { - // Keep this match like that without a wildcard `_` so we don't forget to update it + // Keep this match without a wildcard `_` so we never forget to update it match self { Tar | Zip | Rar | SevenZip => true, - Gzip => false, - Bzip => false, - Bzip3 => false, - Lz4 => false, - Lzma => false, - Snappy => false, - Zstd => false, - Brotli => false, + Bzip | Bzip3 | Lz4 | Lzma | Xz | Lzip | Snappy | Zstd | Brotli | Gzip => false, } } } @@ -130,7 +126,9 @@ fn to_extension(ext: &[u8]) -> Option { b"tbz" | b"tbz2" => &[Tar, Bzip], b"tbz3" => &[Tar, Bzip3], b"tlz4" => &[Tar, Lz4], - b"txz" | b"tlzma" => &[Tar, Lzma], + b"txz" => &[Tar, Xz], + b"tlzma" => &[Tar, Lzma], + b"tlz" => &[Tar, Lzip], b"tsz" => &[Tar, Snappy], b"tzst" => &[Tar, Zstd], b"zip" => &[Zip], @@ -138,7 +136,9 @@ fn to_extension(ext: &[u8]) -> Option { b"bz3" => &[Bzip3], b"gz" => &[Gzip], b"lz4" => &[Lz4], - b"xz" | b"lzma" => &[Lzma], + b"xz" => &[Xz], + b"lzma" => &[Lzma], + b"lz" => &[Lzip], b"sz" => &[Snappy], b"zst" => &[Zstd], b"rar" => &[Rar], diff --git a/src/utils/fs.rs b/src/utils/fs.rs index 21c2457af..0f552521d 100644 --- a/src/utils/fs.rs +++ b/src/utils/fs.rs @@ -135,9 +135,15 @@ pub fn try_infer_extension(path: &Path) -> Option { fn is_bz3(buf: &[u8]) -> bool { buf.starts_with(b"BZ3v1") } + fn is_lzma(buf: &[u8]) -> bool { + buf.len() >= 14 && buf[0] == 0x5d && (buf[12] == 0x00 || buf[12] == 0xff) && buf[13] == 0x00 + } fn is_xz(buf: &[u8]) -> bool { buf.starts_with(&[0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00]) } + fn is_lzip(buf: &[u8]) -> bool { + buf.starts_with(&[0x4C, 0x5A, 0x49, 0x50]) + } fn is_lz4(buf: &[u8]) -> bool { buf.starts_with(&[0x04, 0x22, 0x4D, 0x18]) } @@ -183,8 +189,12 @@ pub fn try_infer_extension(path: &Path) -> Option { Some(Extension::new(&[Bzip], "bz2")) } else if is_bz3(&buf) { Some(Extension::new(&[Bzip3], "bz3")) + } else if is_lzma(&buf) { + Some(Extension::new(&[Lzma], "lzma")) } else if is_xz(&buf) { - Some(Extension::new(&[Lzma], "xz")) + Some(Extension::new(&[Xz], "xz")) + } else if is_lzip(&buf) { + Some(Extension::new(&[Lzip], "lzip")) } else if is_lz4(&buf) { Some(Extension::new(&[Lz4], "lz4")) } else if is_sz(&buf) { diff --git a/tests/integration.rs b/tests/integration.rs index 1883b0e59..7df399552 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -33,7 +33,6 @@ enum DirectoryExtension { Tbz3, Tgz, Tlz4, - Tlzma, Tsz, Txz, Tzst, @@ -50,7 +49,6 @@ enum FileExtension { Bz3, Gz, Lz4, - Lzma, Sz, Xz, Zst, diff --git a/tests/mime.rs b/tests/mime.rs index bf5217984..a09b13183 100644 --- a/tests/mime.rs +++ b/tests/mime.rs @@ -17,8 +17,7 @@ fn sanity_check_through_mime() { write_random_content(test_file, &mut SmallRng::from_entropy()); let formats = [ - "7z", "tar", "zip", "tar.gz", "tgz", "tbz", "tbz2", "txz", "tlzma", "tzst", "tar.bz", "tar.bz2", "tar.lzma", - "tar.xz", "tar.zst", + "7z", "tar", "zip", "tar.gz", "tgz", "tbz", "tbz2", "txz", "tzst", "tar.bz", "tar.bz2", "tar.xz", "tar.zst", ]; let expected_mimes = [ @@ -30,12 +29,10 @@ fn sanity_check_through_mime() { "application/x-bzip2", "application/x-bzip2", "application/x-xz", - "application/x-xz", "application/zstd", "application/x-bzip2", "application/x-bzip2", "application/x-xz", - "application/x-xz", "application/zstd", ]; diff --git a/tests/snapshots/ui__ui_test_err_decompress_missing_extension_with_rar-1.snap b/tests/snapshots/ui__ui_test_err_decompress_missing_extension_with_rar-1.snap index 61ffed686..37b1add2b 100644 --- a/tests/snapshots/ui__ui_test_err_decompress_missing_extension_with_rar-1.snap +++ b/tests/snapshots/ui__ui_test_err_decompress_missing_extension_with_rar-1.snap @@ -6,8 +6,8 @@ expression: "run_ouch(\"ouch decompress a\", dir)" - Files with missing extensions: /a - Decompression formats are detected automatically from file extension -hint: Supported extensions are: tar, zip, bz, bz2, bz3, gz, lz4, xz, lzma, sz, zst, rar, 7z -hint: Supported aliases are: tgz, tbz, tlz4, txz, tzlma, tsz, tzst +hint: Supported extensions are: tar, zip, bz, bz2, bz3, gz, lz4, xz, lzma, lz, sz, zst, rar, 7z +hint: Supported aliases are: tgz, tbz, tlz4, txz, tlzma, tsz, tzst, tlz hint: hint: Alternatively, you can pass an extension to the '--format' flag: hint: ouch decompress /a --format tar.gz diff --git a/tests/snapshots/ui__ui_test_err_decompress_missing_extension_with_rar-2.snap b/tests/snapshots/ui__ui_test_err_decompress_missing_extension_with_rar-2.snap index fe1bbf9aa..20516bf36 100644 --- a/tests/snapshots/ui__ui_test_err_decompress_missing_extension_with_rar-2.snap +++ b/tests/snapshots/ui__ui_test_err_decompress_missing_extension_with_rar-2.snap @@ -7,5 +7,5 @@ expression: "run_ouch(\"ouch decompress a b.unknown\", dir)" - Files with missing extensions: /a - Decompression formats are detected automatically from file extension -hint: Supported extensions are: tar, zip, bz, bz2, bz3, gz, lz4, xz, lzma, sz, zst, rar, 7z -hint: Supported aliases are: tgz, tbz, tlz4, txz, tzlma, tsz, tzst +hint: Supported extensions are: tar, zip, bz, bz2, bz3, gz, lz4, xz, lzma, lz, sz, zst, rar, 7z +hint: Supported aliases are: tgz, tbz, tlz4, txz, tlzma, tsz, tzst, tlz diff --git a/tests/snapshots/ui__ui_test_err_decompress_missing_extension_with_rar-3.snap b/tests/snapshots/ui__ui_test_err_decompress_missing_extension_with_rar-3.snap index 0ef66a216..50cbb0d0a 100644 --- a/tests/snapshots/ui__ui_test_err_decompress_missing_extension_with_rar-3.snap +++ b/tests/snapshots/ui__ui_test_err_decompress_missing_extension_with_rar-3.snap @@ -6,8 +6,8 @@ expression: "run_ouch(\"ouch decompress b.unknown\", dir)" - Files with unsupported extensions: /b.unknown - Decompression formats are detected automatically from file extension -hint: Supported extensions are: tar, zip, bz, bz2, bz3, gz, lz4, xz, lzma, sz, zst, rar, 7z -hint: Supported aliases are: tgz, tbz, tlz4, txz, tzlma, tsz, tzst +hint: Supported extensions are: tar, zip, bz, bz2, bz3, gz, lz4, xz, lzma, lz, sz, zst, rar, 7z +hint: Supported aliases are: tgz, tbz, tlz4, txz, tlzma, tsz, tzst, tlz hint: hint: Alternatively, you can pass an extension to the '--format' flag: hint: ouch decompress /b.unknown --format tar.gz diff --git a/tests/snapshots/ui__ui_test_err_decompress_missing_extension_without_rar-1.snap b/tests/snapshots/ui__ui_test_err_decompress_missing_extension_without_rar-1.snap index 2885d83bd..c9f0719a2 100644 --- a/tests/snapshots/ui__ui_test_err_decompress_missing_extension_without_rar-1.snap +++ b/tests/snapshots/ui__ui_test_err_decompress_missing_extension_without_rar-1.snap @@ -6,8 +6,8 @@ expression: "run_ouch(\"ouch decompress a\", dir)" - Files with missing extensions: /a - Decompression formats are detected automatically from file extension -hint: Supported extensions are: tar, zip, bz, bz2, bz3, gz, lz4, xz, lzma, sz, zst, 7z -hint: Supported aliases are: tgz, tbz, tlz4, txz, tzlma, tsz, tzst +hint: Supported extensions are: tar, zip, bz, bz2, bz3, gz, lz4, xz, lzma, lz, sz, zst, 7z +hint: Supported aliases are: tgz, tbz, tlz4, txz, tlzma, tsz, tzst, tlz hint: hint: Alternatively, you can pass an extension to the '--format' flag: hint: ouch decompress /a --format tar.gz diff --git a/tests/snapshots/ui__ui_test_err_decompress_missing_extension_without_rar-2.snap b/tests/snapshots/ui__ui_test_err_decompress_missing_extension_without_rar-2.snap index 9cdcbd6ea..cc7dcaf4f 100644 --- a/tests/snapshots/ui__ui_test_err_decompress_missing_extension_without_rar-2.snap +++ b/tests/snapshots/ui__ui_test_err_decompress_missing_extension_without_rar-2.snap @@ -7,5 +7,5 @@ expression: "run_ouch(\"ouch decompress a b.unknown\", dir)" - Files with missing extensions: /a - Decompression formats are detected automatically from file extension -hint: Supported extensions are: tar, zip, bz, bz2, bz3, gz, lz4, xz, lzma, sz, zst, 7z -hint: Supported aliases are: tgz, tbz, tlz4, txz, tzlma, tsz, tzst +hint: Supported extensions are: tar, zip, bz, bz2, bz3, gz, lz4, xz, lzma, lz, sz, zst, 7z +hint: Supported aliases are: tgz, tbz, tlz4, txz, tlzma, tsz, tzst, tlz diff --git a/tests/snapshots/ui__ui_test_err_decompress_missing_extension_without_rar-3.snap b/tests/snapshots/ui__ui_test_err_decompress_missing_extension_without_rar-3.snap index 5e57d8b04..ebf00d59a 100644 --- a/tests/snapshots/ui__ui_test_err_decompress_missing_extension_without_rar-3.snap +++ b/tests/snapshots/ui__ui_test_err_decompress_missing_extension_without_rar-3.snap @@ -6,8 +6,8 @@ expression: "run_ouch(\"ouch decompress b.unknown\", dir)" - Files with unsupported extensions: /b.unknown - Decompression formats are detected automatically from file extension -hint: Supported extensions are: tar, zip, bz, bz2, bz3, gz, lz4, xz, lzma, sz, zst, 7z -hint: Supported aliases are: tgz, tbz, tlz4, txz, tzlma, tsz, tzst +hint: Supported extensions are: tar, zip, bz, bz2, bz3, gz, lz4, xz, lzma, lz, sz, zst, 7z +hint: Supported aliases are: tgz, tbz, tlz4, txz, tlzma, tsz, tzst, tlz hint: hint: Alternatively, you can pass an extension to the '--format' flag: hint: ouch decompress /b.unknown --format tar.gz diff --git a/tests/snapshots/ui__ui_test_err_format_flag_with_rar-1.snap b/tests/snapshots/ui__ui_test_err_format_flag_with_rar-1.snap index 5cb36e405..43277dabb 100644 --- a/tests/snapshots/ui__ui_test_err_format_flag_with_rar-1.snap +++ b/tests/snapshots/ui__ui_test_err_format_flag_with_rar-1.snap @@ -5,8 +5,8 @@ expression: "run_ouch(\"ouch compress input output --format tar.gz.unknown\", di [ERROR] Failed to parse `--format tar.gz.unknown` - Unsupported extension 'unknown' -hint: Supported extensions are: tar, zip, bz, bz2, bz3, gz, lz4, xz, lzma, sz, zst, rar, 7z -hint: Supported aliases are: tgz, tbz, tlz4, txz, tzlma, tsz, tzst +hint: Supported extensions are: tar, zip, bz, bz2, bz3, gz, lz4, xz, lzma, lz, sz, zst, rar, 7z +hint: Supported aliases are: tgz, tbz, tlz4, txz, tlzma, tsz, tzst, tlz hint: hint: Examples: hint: --format tar diff --git a/tests/snapshots/ui__ui_test_err_format_flag_with_rar-2.snap b/tests/snapshots/ui__ui_test_err_format_flag_with_rar-2.snap index a1196c786..43b9c08b3 100644 --- a/tests/snapshots/ui__ui_test_err_format_flag_with_rar-2.snap +++ b/tests/snapshots/ui__ui_test_err_format_flag_with_rar-2.snap @@ -5,8 +5,8 @@ expression: "run_ouch(\"ouch compress input output --format targz\", dir)" [ERROR] Failed to parse `--format targz` - Unsupported extension 'targz' -hint: Supported extensions are: tar, zip, bz, bz2, bz3, gz, lz4, xz, lzma, sz, zst, rar, 7z -hint: Supported aliases are: tgz, tbz, tlz4, txz, tzlma, tsz, tzst +hint: Supported extensions are: tar, zip, bz, bz2, bz3, gz, lz4, xz, lzma, lz, sz, zst, rar, 7z +hint: Supported aliases are: tgz, tbz, tlz4, txz, tlzma, tsz, tzst, tlz hint: hint: Examples: hint: --format tar diff --git a/tests/snapshots/ui__ui_test_err_format_flag_with_rar-3.snap b/tests/snapshots/ui__ui_test_err_format_flag_with_rar-3.snap index 4269a2399..861fdf96b 100644 --- a/tests/snapshots/ui__ui_test_err_format_flag_with_rar-3.snap +++ b/tests/snapshots/ui__ui_test_err_format_flag_with_rar-3.snap @@ -5,8 +5,8 @@ expression: "run_ouch(\"ouch compress input output --format .tar.$#!@.rest\", di [ERROR] Failed to parse `--format .tar.$#!@.rest` - Unsupported extension '$#!@' -hint: Supported extensions are: tar, zip, bz, bz2, bz3, gz, lz4, xz, lzma, sz, zst, rar, 7z -hint: Supported aliases are: tgz, tbz, tlz4, txz, tzlma, tsz, tzst +hint: Supported extensions are: tar, zip, bz, bz2, bz3, gz, lz4, xz, lzma, lz, sz, zst, rar, 7z +hint: Supported aliases are: tgz, tbz, tlz4, txz, tlzma, tsz, tzst, tlz hint: hint: Examples: hint: --format tar diff --git a/tests/snapshots/ui__ui_test_err_format_flag_without_rar-1.snap b/tests/snapshots/ui__ui_test_err_format_flag_without_rar-1.snap index cd7ccbc3c..b3a3b1a03 100644 --- a/tests/snapshots/ui__ui_test_err_format_flag_without_rar-1.snap +++ b/tests/snapshots/ui__ui_test_err_format_flag_without_rar-1.snap @@ -5,8 +5,8 @@ expression: "run_ouch(\"ouch compress input output --format tar.gz.unknown\", di [ERROR] Failed to parse `--format tar.gz.unknown` - Unsupported extension 'unknown' -hint: Supported extensions are: tar, zip, bz, bz2, bz3, gz, lz4, xz, lzma, sz, zst, 7z -hint: Supported aliases are: tgz, tbz, tlz4, txz, tzlma, tsz, tzst +hint: Supported extensions are: tar, zip, bz, bz2, bz3, gz, lz4, xz, lzma, lz, sz, zst, 7z +hint: Supported aliases are: tgz, tbz, tlz4, txz, tlzma, tsz, tzst, tlz hint: hint: Examples: hint: --format tar diff --git a/tests/snapshots/ui__ui_test_err_format_flag_without_rar-2.snap b/tests/snapshots/ui__ui_test_err_format_flag_without_rar-2.snap index 0913264f7..4c1a7c09c 100644 --- a/tests/snapshots/ui__ui_test_err_format_flag_without_rar-2.snap +++ b/tests/snapshots/ui__ui_test_err_format_flag_without_rar-2.snap @@ -5,8 +5,8 @@ expression: "run_ouch(\"ouch compress input output --format targz\", dir)" [ERROR] Failed to parse `--format targz` - Unsupported extension 'targz' -hint: Supported extensions are: tar, zip, bz, bz2, bz3, gz, lz4, xz, lzma, sz, zst, 7z -hint: Supported aliases are: tgz, tbz, tlz4, txz, tzlma, tsz, tzst +hint: Supported extensions are: tar, zip, bz, bz2, bz3, gz, lz4, xz, lzma, lz, sz, zst, 7z +hint: Supported aliases are: tgz, tbz, tlz4, txz, tlzma, tsz, tzst, tlz hint: hint: Examples: hint: --format tar diff --git a/tests/snapshots/ui__ui_test_err_format_flag_without_rar-3.snap b/tests/snapshots/ui__ui_test_err_format_flag_without_rar-3.snap index 7d9b12c0f..7cbbe2f7f 100644 --- a/tests/snapshots/ui__ui_test_err_format_flag_without_rar-3.snap +++ b/tests/snapshots/ui__ui_test_err_format_flag_without_rar-3.snap @@ -5,8 +5,8 @@ expression: "run_ouch(\"ouch compress input output --format .tar.$#!@.rest\", di [ERROR] Failed to parse `--format .tar.$#!@.rest` - Unsupported extension '$#!@' -hint: Supported extensions are: tar, zip, bz, bz2, bz3, gz, lz4, xz, lzma, sz, zst, 7z -hint: Supported aliases are: tgz, tbz, tlz4, txz, tzlma, tsz, tzst +hint: Supported extensions are: tar, zip, bz, bz2, bz3, gz, lz4, xz, lzma, lz, sz, zst, 7z +hint: Supported aliases are: tgz, tbz, tlz4, txz, tlzma, tsz, tzst, tlz hint: hint: Examples: hint: --format tar diff --git a/tests/snapshots/ui__ui_test_usage_help_flag.snap b/tests/snapshots/ui__ui_test_usage_help_flag.snap index 6913b83d0..9f3f8dbb5 100644 --- a/tests/snapshots/ui__ui_test_usage_help_flag.snap +++ b/tests/snapshots/ui__ui_test_usage_help_flag.snap @@ -5,7 +5,7 @@ snapshot_kind: text --- A command-line utility for easily compressing and decompressing files and directories. -Supported formats: tar, zip, gz, 7z, xz/lzma, bz/bz2, bz3, lz4, sz (Snappy), zst, rar and br. +Supported formats: tar, zip, gz, 7z, xz, lzma, lzip, bz/bz2, bz3, lz4, sz (Snappy), zst, rar and br. Repository: https://github.com/ouch-org/ouch