better error handling in whatnow2
authorPhilipp Takacs <philipp@bureaucracy.de>
Fri, 12 Aug 2016 16:11:11 +0000 (18:11 +0200)
committerPhilipp Takacs <philipp@bureaucracy.de>
Fri, 12 Aug 2016 16:11:11 +0000 (18:11 +0200)
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

index dbddb55..4f957e2 100755 (executable)
@@ -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