Añadida página man y cambios en install.sh y lch

This commit is contained in:
2020-07-15 15:18:28 +02:00
parent 1312541ce6
commit 8c85d2db14
4 changed files with 85 additions and 6 deletions
View File
+23 -1
View File
@@ -1,3 +1,25 @@
#!/bin/bash #!/bin/bash
cp lch /usr/bin/lch 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
+13 -5
View File
@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
VERSION=0.1r6 VERSION=0.1r7
if [ "$1" = "version" ] || [ "$1" = "--version" ] || [ "$1" = "-v" ] if [ "$1" = "version" ] || [ "$1" = "--version" ] || [ "$1" = "-v" ]
then then
@@ -12,7 +12,7 @@ else
echo "" echo ""
fi fi
function descompressor() function decompressor()
{ {
case $1 in case $1 in
*.tar) *.tar)
@@ -40,7 +40,7 @@ function descompressor()
7za e $1 7za e $1
;; ;;
*) *)
echo "Extent not found." echo "Extension not found."
echo "For more information --help" echo "For more information --help"
echo "" echo ""
;; ;;
@@ -118,6 +118,14 @@ then
exit 0 exit 0
fi fi
if [ "$1" = "version" ] || [ "$1" = "--version" ] || [ "$1" = "-v" ]
then
echo ""
echo "lch $VERSION"
echo ""
exit 0
fi
if [ -z "$1" ] || [ -n "$3" ] if [ -z "$1" ] || [ -n "$3" ]
then then
echo "Wrong arguments" echo "Wrong arguments"
@@ -132,9 +140,9 @@ else
echo "" echo ""
compressor $1 $2 compressor $1 $2
else else
echo "Descompressor:" echo "Decompressor:"
echo "--------------" echo "--------------"
echo "" echo ""
descompressor $1 decompressor $1
fi fi
fi fi
+49
View File
@@ -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 <gore@hatthieves.es>
.SH AUTHOR
\fBlch\fP are by Gustavo Adolfo Mesa Roldan <gore@hackthieves.es.>
This document is by radikal <radikal@disroot.org>.