From 75efa1e0fba76daa240c3c8b99deaf45fbb09fde Mon Sep 17 00:00:00 2001 From: Philipp Takacs Date: Fri, 12 Aug 2016 18:11:11 +0200 Subject: [PATCH 1/1] better error handling in whatnow2 if the command is unknown then usage is printed and if usage is called with an argument other then 0 exit 1 is forced. --- uip/whatnow2.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/uip/whatnow2.sh b/uip/whatnow2.sh index dbddb55..4f957e2 100755 --- a/uip/whatnow2.sh +++ b/uip/whatnow2.sh @@ -38,7 +38,7 @@ usage() exit 0 fi printhelp 1>&2 - exit $1 + exit 1 } get_editor() @@ -293,4 +293,7 @@ w|wh|who|whom) -V|-Ve|-Ver|-Vers|-Versi|-Versio|-Version) version $# ;; +*) + usage 1 + ;; esac -- 1.7.10.4