vopt_bool: use option as default property

Keep it in-line with vopt_with and vopt_enable.
This commit is contained in:
Đoàn Trần Công Danh 2020-09-18 20:00:47 +07:00 committed by Daniel Kolesa
parent 63283d403c
commit b1a6baed7f

View file

@ -30,10 +30,8 @@ vopt_conflict() {
}
vopt_bool() {
local opt="$1" prop="$2"
if [ "$#" -lt "2" ]; then
msg_error "vopt_bool <build_option> <property>: 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"