|
|
@ -196,17 +196,16 @@ function coords(arg, arg_name, skip_validation)
|
|
|
|
return pos
|
|
|
|
return pos
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local toBool={["true"]=true,["yes"]=true,["y"]=true,["on"]=true,["1"]=true,
|
|
|
|
|
|
|
|
["false"]=false,["no"]=false,["n"]=false,["off"]=false,["0"]=false}
|
|
|
|
function boolean(arg, arg_name)
|
|
|
|
function boolean(arg, arg_name)
|
|
|
|
local toBool={["true"]=true,["yes"]=true,["y"]=true,["on"]=true,["1"]=true,
|
|
|
|
local arg_lower = string.lower(arg)
|
|
|
|
["false"]=false,["no"]=false,["n"]=false,["off"]=false,["0"]=false}
|
|
|
|
if toBool[arg_lower] == nil then
|
|
|
|
|
|
|
|
|
|
|
|
arg = string.lower(arg)
|
|
|
|
|
|
|
|
if toBool[arg] == nil then
|
|
|
|
|
|
|
|
arg_error(arg_name,
|
|
|
|
arg_error(arg_name,
|
|
|
|
'unknown value: "%s"; expected "true", "yes", "false", or "no"')
|
|
|
|
'unknown value: "%s"; expected "true", "yes", "false", or "no"', arg)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
return toBool[arg]
|
|
|
|
return toBool[arg_lower]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
return _ENV
|
|
|
|
return _ENV
|
|
|
|