Browse Source

code ordered

master
radikal 3 years ago
parent
commit
d71e11b4d0
1 changed files with 15 additions and 20 deletions
  1. +15
    -20
      lch

+ 15
- 20
lch 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 " For more information --help"
echo "Extension not found."
echo "For more information run 'lch --help'"
echo "" echo ""
;; ;;
esac esac
@ -91,11 +80,12 @@ 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" ]
@ -123,17 +115,20 @@ then
fi 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


Loading…
Cancel
Save