fix bug in allowedargcount() to not execute command if wrong args count

This commit is contained in:
roxchgt 2019-11-28 18:45:13 +01:00 committed by spacewander
parent 292149c46f
commit 45647fdab3

View file

@ -95,8 +95,11 @@ function wsnameToCurrent () {
}
# helper to check number of arguments
function allowedargcount () {
( test "$paramcount" -ne "$1" ) && ( usage && echo 1>&2 "error: wrong number of arguments" && exit 1 )
function allowedargcount {
if test "$paramcount" -ne $1; then
echo 1>&2 "error: wrong number of arguments" && usage
exit 1;
fi
}
# execute the bulk operation