From ab780fd935672d047cd2db4366ae5b8e9b9c3f07 Mon Sep 17 00:00:00 2001 From: radikal Date: Sun, 2 Aug 2020 18:13:30 +0200 Subject: [PATCH] Added support for compress multiple files --- README.md | 2 +- lch | 13 ++++++++----- lch.1 | 6 +++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 9ede0d1..7d32f89 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ###### Compress ``` -$ lch file.zip archive/ +$ lch file.zip archive1/ [archive2/] [...] ``` ###### Decompress diff --git a/lch b/lch index 8cb9e8a..0e297f5 100755 --- a/lch +++ b/lch @@ -1,5 +1,5 @@ #!/bin/bash -VERSION=0.1r7 +VERSION=0.1r8 function decompressor() { @@ -125,19 +125,22 @@ else echo "" fi -if [ -z "$1" ] || [ -n "$3" ] +if [ -z "$1" ] then echo "Wrong arguments" - echo "For more information run 'lch --help'" echo "" - exit 0 + help + exit 1 else if [ -n "$2" ] then echo "Compressor:" echo "-----------" echo "" - compressor $1 $2 + DEST=$1 + shift 1 + ORIG=$@ + compressor $DEST $ORIG else echo "Decompressor:" echo "-------------" diff --git a/lch.1 b/lch.1 index 4f6b341..e1f81a9 100644 --- a/lch.1 +++ b/lch.1 @@ -2,7 +2,7 @@ .SH NAME lch \- command\-line compressor and decompressor for humans .SH SYNOPSIS -\fBlch\fP [filename [filename]] +\fBlch\fP [filename [filename1] [filename2]...] \fBlch\fP [\fIflags\fP] .SH DESCRIPTION @@ -37,8 +37,8 @@ Print current version. will decompress file foobar.tar.gz .TP -\fBlch foobar.tar.gz foobar/\fP -will compress foobar/ in foobar.tar.gz +\fBlch foobar.tar.gz foobar1/ foobar2/\fP +will compress foobar1/ and foobar2/ in foobar.tar.gz .SH BUGS Report your bugs at