Merge r4097

This commit is contained in:
Jo-Philipp Wich 2009-01-30 15:36:49 +00:00
parent 6c83242d9d
commit 9856a5f602

View file

@ -135,6 +135,16 @@ function Cursor.tset(self, config, section, values)
return stat
end
--- Get a boolean option and return it's value as true or false.
-- @param config UCI config
-- @param section UCI section name
-- @param option UCI option
-- @return Boolean
function Cursor.get_bool(self, ...)
local val = self:get(...)
return ( val == "1" or val == "true" or val == "yes" or val == "on" )
end
--- Get an option or list and return values as table.
-- @param config UCI config
-- @param section UCI section name