Fix arguments handling

Now all arguments are parsed. A non-valid argument will exit the program with an error.
This commit is contained in:
Alexis Ben Miloud--Josselin 2019-10-02 17:54:51 +02:00
parent 1cc11d39ee
commit c4f4166146
1 changed files with 3 additions and 1 deletions

View File

@ -19,7 +19,7 @@ done
POW=$(echo 1024 ^ 3 | bc)
FMT=human
while [ $# -ne 0 ] && echo "$1" | grep -q '^-[[:alnum:]]'
while [ $# -ne 0 ]
do
case $1 in
'-a')
@ -40,6 +40,7 @@ do
usage
;;
esac
shift
;;
'-u')
case $2 in
@ -55,6 +56,7 @@ do
*)
usage
esac
shift
;;
*)
usage