aboutsummaryrefslogtreecommitdiff
path: root/src/xz/args.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2022-10-08 21:28:15 +0300
committerLasse Collin <lasse.collin@tukaani.org>2022-11-09 14:28:41 +0200
commit3176f992c55b8d788c4633809aaf9447376a5a12 (patch)
treea08fb57cecafafb4d41bd1b2df3007d61aff513d /src/xz/args.c
parentliblzma: Add .lz support to lzma_auto_decoder(). (diff)
downloadxz-3176f992c55b8d788c4633809aaf9447376a5a12.tar.xz
xz: Add .lz (lzip) decompression support.
If configured with --disable-lzip-decoder then --long-help will still list `lzip' in --format but I left it like that since due to translations it would be messy to have two help strings. Features are disabled only in special situations so wrong help in such a situation shouldn't matter much. Thanks to Michał Górny for the original patch.
Diffstat (limited to 'src/xz/args.c')
-rw-r--r--src/xz/args.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/xz/args.c b/src/xz/args.c
index 941214b5..2af39098 100644
--- a/src/xz/args.c
+++ b/src/xz/args.c
@@ -412,6 +412,9 @@ parse_real(args_info *args, int argc, char **argv)
{ "xz", FORMAT_XZ },
{ "lzma", FORMAT_LZMA },
{ "alone", FORMAT_LZMA },
+#ifdef HAVE_LZIP_DECODER
+ { "lzip", FORMAT_LZIP },
+#endif
// { "gzip", FORMAT_GZIP },
// { "gz", FORMAT_GZIP },
{ "raw", FORMAT_RAW },
@@ -668,6 +671,12 @@ args_parse(args_info *args, int argc, char **argv)
"at build time"));
#endif
+#ifdef HAVE_LZIP_DECODER
+ if (opt_mode == MODE_COMPRESS && opt_format == FORMAT_LZIP)
+ message_fatal(_("Compression of lzip files (.lz) "
+ "is not supported"));
+#endif
+
// Never remove the source file when the destination is not on disk.
// In test mode the data is written nowhere, but setting opt_stdout
// will make the rest of the code behave well.