exit on unsupported flags

This commit is contained in:
Denis Lehmann 2023-09-22 09:24:05 +02:00
parent c1d456d6eb
commit ee7898c5ee

8
gis
View file

@ -23,7 +23,7 @@ OPTIONS
in PATHS in PATHS
-h, --help Show this help message and exit -h, --help Show this help message and exit
EOF EOF
exit exit "$1"
} }
# Parse arguments # Parse arguments
@ -40,11 +40,11 @@ while (( "$#" )); do
shift shift
;; ;;
-h|--help) -h|--help)
print_usage print_usage 0
;; ;;
-*) -*)
echo "${text_bold}${text_red}Unsupported flag${text_reset} $1" echo -e "${text_bold}${text_red}Unsupported flag${text_reset} $1\n"
shift print_usage 1
;; ;;
*) *)
paths+=("$(realpath "$1")") paths+=("$(realpath "$1")")