0.2r1 - Verification of compression systems

This commit is contained in:
Gustavo Adolfo Mesa Roldán
2020-09-26 22:03:23 +02:00
parent d0f29fa001
commit d31bc2f360
2 changed files with 54 additions and 17 deletions
+36 -3
View File
@@ -1,5 +1,5 @@
#!/bin/bash
VERSION=0.1r8
VERSION=0.2r1
DEST=$1
shift 1
ORIG=$@
@@ -84,15 +84,15 @@ function compressor()
function help()
{
# echo ""
echo "Help:"
echo "-----"
echo ""
echo "lch [-h] [-v] [FILE [FILE]]"
echo "lch [-h] [-v] [-c] [FILE [FILE]]"
echo ""
echo "Examples:"
echo "$ lch -h -This help"
echo "$ lch -v -print version"
echo "$ lch -c -check compresion systems"
echo "$ lch file.zip /home/file -Compress"
echo "$ lch file.zip -Decompress"
echo ""
@@ -103,12 +103,45 @@ function help()
echo ""
}
function check()
{
local a=false
echo "Verification of compression systems:"
echo ""
echo -e "Systems\t\t\tStatus"
echo "----------------------------------"
for i in "tar" "bzip2" "gzip" "zip" "7za"
do
if ! [ -x "$(command -v $i)" ]
then
echo -e "$i\t\t\t\e[91mNot Installed\e[0m"
$a = true
else
echo -e "$i\t\t\t\e[32mInstaled\e[0m"
fi
done
if $a
then
echo ""
echo "In order to use all the extensions install the packages: tar, bzip2, gzip, zip, 7za"
fi
echo ""
exit 0
}
if [ "$DEST" = "--help" ] || [ "$DEST" = "-h" ]
then
help
exit 0
fi
if [ "$DEST" = "--check" ] || [ "$DEST" = "-c" ]
then
check
exit 0
fi
if [ "$DEST" = "--version" ] || [ "$DEST" = "-v" ]
then
echo "Linux Compression Humanized $VERSION"
+5 -1
View File
@@ -21,6 +21,10 @@ Help: show syntax.
.TP
\fI\-v, \-\-version\fP
Print current version.
.TP
\fI\-c, \-\-check\fP
Print a check the compressors installed.
.SH EXAMPLES
@@ -36,6 +40,6 @@ will compress foobar1/ and foobar2/ in foobar.tar.gz
Report your bugs at <gore@hatthieves.es>
.SH AUTHOR
\fBlch\fP are by Gustavo Adolfo Mesa Roldan <gore@hackthieves.es.>
\fBlch\fP are by Gustavo Adolfo Mesa Roldan <gore@hackthieves.es>
This document is by radikal <radikal@disroot.org>.