Merge r4097
This commit is contained in:
parent
6c83242d9d
commit
9856a5f602
1 changed files with 19 additions and 9 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue