Merge pull request #527 from switch87/master

changed snippet getopts to work correctly
This commit is contained in:
Honza Pokorny 2015-03-01 12:57:35 +01:00
commit c5a4c4aeec

View File

@ -51,15 +51,12 @@ snippet getopt
#=============================================================================== #===============================================================================
function usage () function usage ()
{ {
cat <<- EOT echo "Usage : $${0:0} [options] [--]
Usage : $${0:0} [options] [--] Options:
-h|help Display this message
-v|version Display script version"
Options:
-h|help Display this message
-v|version Display script version
EOT
} # ---------- end of function usage ---------- } # ---------- end of function usage ----------
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
@ -74,7 +71,7 @@ snippet getopt
v|version ) echo "$${0:0} -- Version $__ScriptVersion"; exit 0 ;; v|version ) echo "$${0:0} -- Version $__ScriptVersion"; exit 0 ;;
\? ) echo -e "\n Option does not exist : $OPTARG\n" * ) echo -e "\n Option does not exist : $OPTARG\n"
usage; exit 1 ;; usage; exit 1 ;;
esac # --- end of case --- esac # --- end of case ---