X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=scripts%2Fvs;h=d1c9fe4dca1ec492a9a4940368bab2e5dcf8915a;hb=6d190c14a22c77768fbc000331d302c0b260a1fb;hp=6719db17394048ed8a80736870e2d179e52b9f3f;hpb=8b8f7b3fa5ba9b4d9bf8bfa5261d537279f8d091;p=hvutilities.git diff --git a/scripts/vs b/scripts/vs index 6719db1..d1c9fe4 100755 --- a/scripts/vs +++ b/scripts/vs @@ -6,12 +6,27 @@ print_usage() { echo "$(basename $0) -- status for version control (${VCS_SUPPORTED})." echo "Usage: $(basename $0) [OPTIONS...]" + echo "Options:" + echo " -h display this help and exit" } -if [ "x${1}" = "x--help" ]; then - print_usage - exit 1 -fi +while getopts "h" flag ;do + case ${flag} in + h) + print_usage + exit 0 + ;; + ?) + echo "${PROG_NAME}: Invalid option: ${OPTARG}." + echo "Try \`${PROG_NAME} --help' for more information." + exit 1 + ;; + esac +done +shift `expr "${OPTIND}" - 1` + +# `$#' now represents the number of arguments after the options. +# `$1' is the first argument, etc. SVN_ST_UNKNOWN_COLOR=$(echo -e '\033[1;34m') # Blue SVN_ST_DELETED_COLOR=$(echo -e '\033[0;31m') # Red