diff options
author | Marius <mariausol@gmail.com> | 2013-03-21 15:00:17 +0200 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2013-03-21 15:00:17 +0200 |
commit | 6bb39561d4571fb85aac56a686b837a9f3c910cd (patch) | |
tree | 87f9b55ac771b742532fec258c637c0b15ec7dae /tex/context/base/trac-xml.lua | |
parent | 41df6a896ad3ab1d8bb6286423e9540b2b34f576 (diff) | |
download | context-6bb39561d4571fb85aac56a686b837a9f3c910cd.tar.gz |
beta 2013.03.21 13:42
Diffstat (limited to 'tex/context/base/trac-xml.lua')
-rw-r--r-- | tex/context/base/trac-xml.lua | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/tex/context/base/trac-xml.lua b/tex/context/base/trac-xml.lua index e44f3c399..39cfcfb22 100644 --- a/tex/context/base/trac-xml.lua +++ b/tex/context/base/trac-xml.lua @@ -41,9 +41,9 @@ local function showhelp(specification,...) -- local short = xmlserialize(short,xs) local short = xmltext(xmlfirst(flag,"/short")) if value then - report("--%-24s %s",formatters["%s=%s"](name,value),short) + report("--%-20s %s",formatters["%s=%s"](name,value),short) else - report("--%-24s %s",name,short) + report("--%-20s %s",name,short) end end report() @@ -66,6 +66,12 @@ local function showhelp(specification,...) report() end end + for comment in xmlcollected(root,"/application/comments/comment") do + local comment = xmltext(comment) + report() + report(comment) + report() + end end local reporthelp = reporters.help @@ -80,13 +86,30 @@ function reporters.help(t,...) end end +local exporters = logs.exporters + function reporters.export(t,method,filename) dofile(resolvers.findfile("trac-exp.lua","tex")) - local exporters = logs.exporters - local result = method and exporters and exporters[method] and exporters[method](t,method) or exporthelp(t) - if type(filename) == "string" and filename ~= "" then - io.savedata(filename,result) + if not exporters or not method then + return exporthelp(t) + end + if method == "all" then + method = table.keys(exporters) else - reporters.lines(t,result) + method = { method } + end + filename = type(filename) == "string" and filename ~= "" and filename or false + for i=1,#method do + local m = method[i] + local result = exporters[m](t,m) + if result and result ~= "" then + if filename then + local fullname = file.replacesuffix(filename,m) + t.report("saving export in %a",fullname) + io.savedata(fullname,result) + else + reporters.lines(t,result) + end + end end end |