From b1a6baed7fba81861c1443865e1c32e034a539f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Fri, 18 Sep 2020 20:00:47 +0700 Subject: [PATCH] vopt_bool: use option as default property Keep it in-line with vopt_with and vopt_enable. --- common/environment/setup/options.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/common/environment/setup/options.sh b/common/environment/setup/options.sh index 948de79a9e1..83e0f9420f9 100644 --- a/common/environment/setup/options.sh +++ b/common/environment/setup/options.sh @@ -30,10 +30,8 @@ vopt_conflict() { } vopt_bool() { - local opt="$1" prop="$2" - if [ "$#" -lt "2" ]; then - msg_error "vopt_bool : missing values\n" - elif [ "$#" -gt "2" ]; then + local opt="$1" prop="${2:-$1}" + if [ "$#" -gt "2" ]; then msg_error "vopt_bool $opt: $(($# - 2)) excess parameter(s)\n" fi vopt_if "$1" "-D${prop}=true" "-D${prop}=false"