root/src/modules-lua/extract_xml.lua

Revision 45b262aa4ccdc69d53062f13866927dd676a817c, 0.5 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 6 years ago)

oops, extract_xml.lua produces just the meta XML, need to docbook it, refs #21

  • Property mode set to 100644
Line 
1 rc = 0
2
3 function extract(file, outfile)
4   local module = file:gsub('.lua$', ''):gsub('/', '.')
5   local M = require(module)
6   if not M or not M.onload then
7     return
8   end
9   M.onload( {
10     xml_description =
11       function(xml)
12         local f = io.open(outfile, "w+")
13         if not f then
14           rc = 2
15         end
16         f:write(xml)
17         f:close()
18       end
19   })
20 end
21
22
23 if (#arg) ~= 2 then
24   print(string.format("%s <module> <outputfile>\n", (arg[0])))
25   os.exit(1)
26 end
27
28 extract(arg[1], arg[2])
29 os.exit(rc)
Note: See TracBrowser for help on using the browser.