From: Philipp Takacs Date: Fri, 12 Aug 2016 16:11:11 +0000 (+0200) Subject: better error handling in whatnow2 X-Git-Tag: mmh-0.3~5 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=75efa1e0fba76daa240c3c8b99deaf45fbb09fde;p=mmh 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. --- 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