code ordered

This commit is contained in:
2020-07-16 03:02:56 +02:00
parent 314674ce9d
commit d71e11b4d0
+13 -18
View File
@@ -1,17 +1,6 @@
#!/bin/bash #!/bin/bash
VERSION=0.1r7 VERSION=0.1r7
if [ "$1" = "version" ] || [ "$1" = "--version" ] || [ "$1" = "-v" ]
then
echo "Linux Compression Humanized $VERSION"
exit 0
else
echo ""
echo "lch $VERSION"
echo "---------"
echo ""
fi
function decompressor() function decompressor()
{ {
case $1 in case $1 in
@@ -41,7 +30,7 @@ function decompressor()
;; ;;
*) *)
echo "Extension not found." echo "Extension not found."
echo "For more information --help" echo "For more information run 'lch --help'"
echo "" echo ""
;; ;;
esac esac
@@ -79,8 +68,8 @@ function compressor()
7za a $1 $2 7za a $1 $2
;; ;;
*) *)
echo "Extent not found." echo "Extension not found."
echo " For more information --help" echo "For more information run 'lch --help'"
echo "" echo ""
;; ;;
esac esac
@@ -92,10 +81,11 @@ function compressor()
function help() function help()
{ {
echo ""
echo "Help:" echo "Help:"
echo "-----" echo "-----"
echo "" echo ""
echo "lch [-h][-v] FILE [FILE]" echo "lch [-h] [-v] [FILE [FILE]]"
echo "" echo ""
echo "Examples:" echo "Examples:"
echo "$ lch -h -This help" echo "$ lch -h -This help"
@@ -114,6 +104,8 @@ function help()
echo "- zip" echo "- zip"
echo "- 7z" echo "- 7z"
echo "" echo ""
echo "Run 'man lch' for more info."
echo ""
} }
if [ "$1" = "--help" ] || [ "$1" = "-h" ] if [ "$1" = "--help" ] || [ "$1" = "-h" ]
@@ -124,16 +116,19 @@ fi
if [ "$1" = "--version" ] || [ "$1" = "-v" ] if [ "$1" = "--version" ] || [ "$1" = "-v" ]
then then
echo "Linux Compression Humanized $VERSION"
exit 0
else
echo "" echo ""
echo "lch $VERSION" echo "lch $VERSION"
echo "---------"
echo "" echo ""
exit 0
fi fi
if [ -z "$1" ] || [ -n "$3" ] if [ -z "$1" ] || [ -n "$3" ]
then then
echo "Wrong arguments" echo "Wrong arguments"
echo "For more information --help" echo "For more information run 'lch --help'"
echo "" echo ""
exit 0 exit 0
else else
@@ -145,7 +140,7 @@ else
compressor $1 $2 compressor $1 $2
else else
echo "Decompressor:" echo "Decompressor:"
echo "--------------" echo "-------------"
echo "" echo ""
decompressor $1 decompressor $1
fi fi