#!/usr/bin/env bash
|
|
VERSION=0.5r1
|
|
DEST=$1
|
|
shift 1
|
|
ORIG=$@
|
|
|
|
if [[ -e /usr/lib/lch/resources.sh ]]; then . /usr/lib/lch/resources.sh; else . ./lib/resources.sh; fi
|
|
if [[ -e /usr/lib/lch/compressor.sh ]]; then . /usr/lib/lch/compressor.sh; else . ./lib/compressor.sh; fi
|
|
if [[ -e /usr/lib/lch/decompressor.sh ]]; then . /usr/lib/lch/decompressor.sh; else . ./lib/decompressor.sh; fi
|
|
if [[ -e /usr/lib/lch/installer.sh ]]; then . /usr/lib/lch/installer.sh; else . ./lib/installer.sh; fi
|
|
|
|
|
|
if [ "$DEST" = "--version" ] || [ "$DEST" = "-v" ]
|
|
then
|
|
echo "Linux Compression Humanized $VERSION"
|
|
exit 0
|
|
else
|
|
echo -e "\nlch $VERSION"
|
|
echo -e "---------\n"
|
|
|
|
case $DEST in
|
|
"--help" | "-h")
|
|
help
|
|
exit 0
|
|
;;
|
|
"--check" | "-c")
|
|
check
|
|
exit 0
|
|
;;
|
|
"--install" | "-i")
|
|
install $DEST $@
|
|
exit 0
|
|
;;
|
|
*)
|
|
if [ -z "$DEST" ]
|
|
then
|
|
help
|
|
exit 1
|
|
else
|
|
if [ -n "$ORIG" ]
|
|
then
|
|
echo "Compressor:"
|
|
echo -e "-----------\n"
|
|
compressor $DEST $ORIG
|
|
else
|
|
echo "Decompressor:"
|
|
echo -e "-------------\n"
|
|
decompressor $DEST
|
|
fi
|
|
fi
|
|
;;
|
|
esac
|
|
fi
|