|
|
@ -196,17 +196,16 @@ function coords(arg, arg_name, skip_validation)
|
|
|
|
return pos
|
|
|
|
return pos
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function boolean(arg, arg_name)
|
|
|
|
|
|
|
|
local toBool={["true"]=true,["yes"]=true,["y"]=true,["on"]=true,["1"]=true,
|
|
|
|
local toBool={["true"]=true,["yes"]=true,["y"]=true,["on"]=true,["1"]=true,
|
|
|
|
["false"]=false,["no"]=false,["n"]=false,["off"]=false,["0"]=false}
|
|
|
|
["false"]=false,["no"]=false,["n"]=false,["off"]=false,["0"]=false}
|
|
|
|
|
|
|
|
function boolean(arg, arg_name)
|
|
|
|
arg = string.lower(arg)
|
|
|
|
local arg_lower = string.lower(arg)
|
|
|
|
if toBool[arg] == nil then
|
|
|
|
if toBool[arg_lower] == 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
|
|
|
|