changed snippet getopts to work correctly
This commit is contained in:
parent
b11832aa68
commit
e1baa6d38e
@ -51,15 +51,13 @@ snippet getopt
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
function usage ()
|
function usage ()
|
||||||
{
|
{
|
||||||
cat <<- EOT
|
echo "
|
||||||
|
|
||||||
Usage : $${0:0} [options] [--]
|
Usage : $${0:0} [options] [--]
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-h|help Display this message
|
-h|help Display this message
|
||||||
-v|version Display script version
|
-v|version Display script version"
|
||||||
|
|
||||||
EOT
|
|
||||||
} # ---------- end of function usage ----------
|
} # ---------- end of function usage ----------
|
||||||
|
|
||||||
#-----------------------------------------------------------------------
|
#-----------------------------------------------------------------------
|
||||||
@ -74,7 +72,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 ---
|
||||||
|
Loading…
Reference in New Issue
Block a user