Skip to content

Commit 47a8902

Browse files
committed
check unrecognized option
1 parent 0a8564a commit 47a8902

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ while [ $# -gt 0 ]; do
5858
args=("${args[@]}" "$@")
5959
break
6060
;;
61+
-*)
62+
echo "${PROG}: unrecognized option '$1'" 1>&2
63+
echo 1>&2
64+
usage 2;
65+
;;
6166
*)
6267
# if not option, treat all follow args as command
6368
args=("${args[@]}" "$@")

find-in-jars

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ while [ $# -gt 0 ]; do
8888
args=("${args[@]}" "$@")
8989
break
9090
;;
91+
-*)
92+
echo "${PROG}: unrecognized option '$1'" 1>&2
93+
echo 1>&2
94+
usage 2;
95+
;;
9196
*)
9297
args=("${args[@]}" "$1")
9398
shift

0 commit comments

Comments
 (0)