add help option
This commit is contained in:
parent
b21c4430ec
commit
31d8b302cf
13
install.sh
13
install.sh
|
@ -2,18 +2,29 @@
|
||||||
_install_dir="/usr/local/bin/"
|
_install_dir="/usr/local/bin/"
|
||||||
_uninstall=0
|
_uninstall=0
|
||||||
_overwrite=0
|
_overwrite=0
|
||||||
|
_exit_status=0
|
||||||
|
_show_help=0
|
||||||
|
|
||||||
for _arg in "$@" ; do
|
for _arg in "$@" ; do
|
||||||
if [ "$_arg" = "-u" ] || [ "$_arg" = "--uninstall" ] ; then
|
if [ "$_arg" = "-u" ] || [ "$_arg" = "--uninstall" ] ; then
|
||||||
_uninstall=1
|
_uninstall=1
|
||||||
elif [ "$_arg" = "-o" ] || [ "$_arg" = "--overwrite" ] ; then
|
elif [ "$_arg" = "-o" ] || [ "$_arg" = "--overwrite" ] ; then
|
||||||
_overwrite=1
|
_overwrite=1
|
||||||
|
elif [ "$_arg" = "-h" ] || [ "$_arg" = "--help" ] ; then
|
||||||
|
_show_help=1
|
||||||
else
|
else
|
||||||
echo "warning: unknown option."
|
echo "warning: unknown option."
|
||||||
exit 1
|
_show_help=1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ "$_show_help" -eq 1 ] ; then
|
||||||
|
echo ""
|
||||||
|
echo "TODO - Show Help"
|
||||||
|
echo "Look at source code for now - there's only two options."
|
||||||
|
exit "$_exit_status"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Install directory: '$_install_dir'"
|
echo "Install directory: '$_install_dir'"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue