* luci/libs: properly implement and document --schemedir in uvl cli
This commit is contained in:
parent
3ea4572c35
commit
6d5efc7925
1 changed files with 9 additions and 2 deletions
|
@ -68,7 +68,8 @@ $Id: uvl.lua 2873 2008-08-17 21:43:56Z jow $
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
uvl --help
|
uvl --help
|
||||||
uvl [--silent] [--no-strict-sections] [--no-strict-options]
|
uvl [--silent] [--schemedir=DIR]
|
||||||
|
[--no-strict-sections] [--no-strict-options]
|
||||||
[--no-strict-validators] config[.section[.option]]
|
[--no-strict-validators] config[.section[.option]]
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
|
@ -78,6 +79,9 @@ Options:
|
||||||
--silent
|
--silent
|
||||||
Don't produce any output.
|
Don't produce any output.
|
||||||
|
|
||||||
|
--schemedir=DIR
|
||||||
|
Use DIR as scheme directory.
|
||||||
|
|
||||||
--no-strict-sections
|
--no-strict-sections
|
||||||
Don't treat sections found in config but not in scheme as error.
|
Don't treat sections found in config but not in scheme as error.
|
||||||
|
|
||||||
|
@ -96,7 +100,10 @@ else
|
||||||
luci.uvl.STRICT_EXTERNAL_VALIDATORS =
|
luci.uvl.STRICT_EXTERNAL_VALIDATORS =
|
||||||
( options['no-strict-validators'] and false or true )
|
( options['no-strict-validators'] and false or true )
|
||||||
|
|
||||||
local uvl = luci.uvl.UVL( options['schemedir'] )
|
local uvl = luci.uvl.UVL(
|
||||||
|
type(options.schemedir) == "string" and options.schemedir or nil
|
||||||
|
)
|
||||||
|
|
||||||
local cso = luci.util.split( arguments[1], "." )
|
local cso = luci.util.split( arguments[1], "." )
|
||||||
local ok, err = uvl:validate( unpack(cso) )
|
local ok, err = uvl:validate( unpack(cso) )
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue