* luci/libs: uvl: Major rewrite of internal element handling, reworked error model...
[project/luci.git] / libs / uvl / root / usr / bin / uvl
index 3f179ee..7dc6a00 100755 (executable)
@@ -11,7 +11,7 @@ You may obtain a copy of the License at
 
         http://www.apache.org/licenses/LICENSE-2.0
 
-$Id: uvl.lua 2873 2008-08-17 21:43:56Z jow $
+$Id$
 
 ]]--
 
@@ -63,14 +63,14 @@ if #arguments == 0 or options.help then
        print([=[
 
 uvl - UCI Validation Layer
-$Id: uvl.lua 2873 2008-08-17 21:43:56Z jow $
+$Id$
 (c) 2008 Jo-Philipp Wich, Steven Barth
 
 Usage:
        uvl --help
        uvl [--silent] [--schemedir=DIR]
-               [--no-strict-sections] [--no-strict-options]
-               [--no-strict-validators] config[.section[.option]]
+               [--no-strict-sections] [--no-strict-options] [--no-strict-validators]
+               [--no-strict-lists] config[.section[.option]]
 
 Options:
        --help
@@ -90,6 +90,9 @@ Options:
 
        --no-strict-validators
                Don't invalidate config if an external validator fails.
+
+       --no-strict-lists
+               Don't invalidate lists that are stored options.
        ]=])
        os.exit(255)
 else
@@ -99,6 +102,8 @@ else
                ( options['no-strict-options'] and false or true )
        luci.uvl.STRICT_EXTERNAL_VALIDATORS =
                ( options['no-strict-validators'] and false or true )
+       luci.uvl.STRICT_LIST_TYPE =
+               ( options['no-strict-lists'] and false or true )
 
        local uvl = luci.uvl.UVL(
                type(options.schemedir) == "string" and options.schemedir or nil
@@ -118,7 +123,7 @@ else
                end
                os.exit( 0 )
        else
-               if not options.silent then print( err ) end
+               if not options.silent then print( err and err:string() or "Unknown error" ) end
                os.exit( 1 )
        end
 end