Browse Source

0.1r3

pull/1/head
Gustavo Adolfo Mesa Roldan 5 years ago
parent
commit
3f5e7c1f6a
1 changed files with 50 additions and 7 deletions
  1. +50
    -7
      lch

+ 50
- 7
lch View File

@ -1,5 +1,16 @@
#!/bin/bash
VERSION=0.1r3
if [ "$1" = "version" ] || [ "$1" = "--version" ] || [ "$1" = "-v" ]
then
echo "Linux Compression Humanized $VERSION"
exit 0
else
echo ""
echo "lch $VERSION"
echo "---------"
echo ""
fi
function descompressor()
{
@ -29,7 +40,9 @@ function descompressor()
7za e $1
;;
*)
echo "Extent not found"
echo "Extent not found."
echo "For more information --help"
echo ""
;;
esac
@ -38,7 +51,6 @@ function descompressor()
exit 0
}
function compressor()
{
case $1 in
@ -69,7 +81,9 @@ function compressor()
7za a $1 $2
;;
*)
echo "Extent not found"
echo "Extent not found."
echo " For more information --help"
echo ""
;;
esac
@ -78,20 +92,49 @@ function compressor()
exit 0
}
function help()
{
echo "Help:"
echo "-----"
echo ""
echo "Examples:"
echo "$ lch file.zip ./route -Compress"
echo "$ lch file.zip -Descompress"
echo ""
echo "Supported extensions:"
echo "- tar"
echo "- tar.gz"
echo "- tar.bz2"
echo "- bz2"
echo "- tgz"
echo "- gz"
echo "- zip"
echo "- 7z"
echo ""
}
if [ "$1" = "help" ] || [ "$1" = "--help" ] || [ "$1" = "-h" ]
then
help
exit 0
fi
if [ -z "$1" ] || [ -n "$3" ]
then
echo "Wrong arguments"
echo "For more information --help"
echo ""
exit 0
else
if [ -n "$2" ]
then
echo "Compressor"
echo "----------"
echo "Compressor:"
echo "-----------"
echo ""
compressor $1 $2
else
echo "Descompressor"
echo "----------"
echo "Descompressor:"
echo "--------------"
echo ""
descompressor $1
fi


Loading…
Cancel
Save