Completed first part of UVLDoc
[project/luci.git] / build / uvldoc
1 #!/usr/bin/env lua
2 local fs = require "luci.fs"
3 local util = require "luci.util"
4 local uvldoc = require "luci.uvldoc.renderer"
5
6 pcall(function()
7 require "uci"
8 require "luci.model.uci".cursor = function(config, save)
9 return uci.cursor(config or arg[1] .. "/etc/config", save or arg[1] .. "/tmp/.uci")
10 end
11 end)
12
13 local schemes = {}
14 if not arg[4] or #arg[4] == 0 then
15 for i, name in ipairs(fs.dir(arg[2].."/default/")) do
16 if name ~= "." and name ~= ".." then
17 schemes[#schemes+1] = name
18 end
19 end
20 else
21 schemes = util.split(arg[4], "[,;%s]+", nil, true)
22 end
23
24 uvldoc.Generator(schemes, arg[3], arg[2]):make()