Exit with an error code if an unknown option is passed
This commit is contained in:
parent
379d411cfd
commit
85fecdbd29
@ -56,6 +56,7 @@ parse_args() {
|
||||
-?*)
|
||||
printf 'Unknown option: %s\n' "$1" >&2
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
*) # Default case: No more options, so break out of the loop.
|
||||
break ;;
|
||||
@ -64,4 +65,4 @@ parse_args() {
|
||||
done
|
||||
}
|
||||
|
||||
parse_args "$@"
|
||||
parse_args "$@"
|
||||
|
Loading…
Reference in New Issue
Block a user