vopt_enable: check for excess parameters

This commit is contained in:
jbu 2015-06-20 10:08:44 +02:00
parent 2aab34f1bc
commit 17107adbca
1 changed files with 3 additions and 0 deletions

View File

@ -16,6 +16,9 @@ vopt_with() {
vopt_enable() {
local opt="$1" flag="${2:-$1}"
if [ "$#" -gt "2" ]; then
msg_error "vopt_enable $opt: $(($# - 2)) excess parameter(s)\n"
fi
vopt_if "$1" "--enable-${flag}" "--disable-${flag}"
}