diff --git a/a b/a deleted file mode 100644 index e69de29..0000000 diff --git a/install.sh b/install.sh index 5a0bb19..bca4991 100755 --- a/install.sh +++ b/install.sh @@ -1,3 +1,25 @@ #!/bin/bash -cp lch /usr/bin/lch \ No newline at end of file +if [ "$UID" != "0" ]; then + echo " Only root can execute this script, sorry." + echo " Try 'sudo ./install.sh'" + exit 0 +fi + +echo "" +echo "======================" +echo " Installing lch" +echo "======================" +echo "" +cp lch /usr/bin/lch +echo " Copied lch in /usr/bin" +cp lch.1 /usr/man/man1/lch.1 +gzip /usr/man/man1/lch.1 +echo " Copied manpage in /usr/man/man1" +echo "" +echo "=============================" +echo " lch installed successfully." +echo "=============================" +echo "" +echo "Run 'lch --help' to see options." +exit 0 diff --git a/lch b/lch index 7074de1..721a4bb 100755 --- a/lch +++ b/lch @@ -1,5 +1,5 @@ #!/bin/bash -VERSION=0.1r6 +VERSION=0.1r7 if [ "$1" = "version" ] || [ "$1" = "--version" ] || [ "$1" = "-v" ] then @@ -12,7 +12,7 @@ else echo "" fi -function descompressor() +function decompressor() { case $1 in *.tar) @@ -40,7 +40,7 @@ function descompressor() 7za e $1 ;; *) - echo "Extent not found." + echo "Extension not found." echo "For more information --help" echo "" ;; @@ -118,6 +118,14 @@ then exit 0 fi +if [ "$1" = "version" ] || [ "$1" = "--version" ] || [ "$1" = "-v" ] +then + echo "" + echo "lch $VERSION" + echo "" + exit 0 +fi + if [ -z "$1" ] || [ -n "$3" ] then echo "Wrong arguments" @@ -132,9 +140,9 @@ else echo "" compressor $1 $2 else - echo "Descompressor:" + echo "Decompressor:" echo "--------------" echo "" - descompressor $1 + decompressor $1 fi fi diff --git a/lch.1 b/lch.1 new file mode 100644 index 0000000..4886ab8 --- /dev/null +++ b/lch.1 @@ -0,0 +1,49 @@ +.TH LCH 1 "15 July 2020" +.SH NAME +lch \- command\-line compressor and decompressor for humans +.SH SYNOPSIS +\fBlch\fP [\fIflags\fP] [filename [filename]] ... + +.SH DESCRIPTION +\fBlch\fP is a command\-line compressor and decompressor for humans with +simplicity in mind. Automatically select the compression format by file +extension. + + Supported extensions: + + - tar + - tar.gz + - tar.bz2 + - tar.xz + - bz2 + - tgz + - gz + - zip + - 7z + +.SH OPTIONS +.TP +\fIhelp, \-h, \-\-help\fP +Help: show syntax. +.TP +\fIversion, \-v, \-\-version\fP +Print current version. + +.SH EXAMPLES + +.TP +\fBlch foobar.tar.gz\fR +will decompress file foobar.tar.gz + +.TP +\fBlch foobar.tar.gz foobar/\fP +will compress foobar/ in foobar.tar.gz + +.SH BUGS +Report your bugs at + +.SH AUTHOR +\fBlch\fP are by Gustavo Adolfo Mesa Roldan + +This document is by radikal . +