{
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