summaryrefslogtreecommitdiff
path: root/scripts/context/lua/mtxrun.lua
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/context/lua/mtxrun.lua')
-rw-r--r--scripts/context/lua/mtxrun.lua47
1 files changed, 28 insertions, 19 deletions
diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua
index 49c43be78..22089df7a 100644
--- a/scripts/context/lua/mtxrun.lua
+++ b/scripts/context/lua/mtxrun.lua
@@ -11211,7 +11211,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["trac-xml"] = package.loaded["trac-xml"] or true
--- original size: 5962, stripped down to: 4596
+-- original size: 6351, stripped down to: 4919
if not modules then modules={} end modules ['trac-xml']={
version=1.001,
@@ -11324,25 +11324,27 @@ function reporters.help(t,...)
reporthelp(t,...)
end
end
-function reporters.export(t,method,filename)
+function reporters.export(t,methods,filename)
if not xmlfound(t) then
return exporthelp(t)
end
- if not method or method=="" then
- method=environment.arguments["exporthelp"]
+ if not methods or methods=="" then
+ methods=environment.arguments["exporthelp"]
end
if not filename or filename=="" then
filename=environment.files[1]
end
dofile(resolvers.findfile("trac-exp.lua","tex"))
local exporters=logs.exporters
- if not exporters or not method then
+ if not exporters or not methods then
return exporthelp(t)
end
- if method=="all" then
- method=table.keys(exporters)
+ if methods=="all" then
+ methods=table.keys(exporters)
+ elseif type(methods)=="string" then
+ methods=utilities.parsers.settings_to_array(methods)
else
- method={ method }
+ return exporthelp(t)
end
if type(filename)~="string" or filename=="" then
filename=false
@@ -11350,17 +11352,24 @@ function reporters.export(t,method,filename)
t.report("export file %a will not be saved on the current path (safeguard)",filename)
return
end
- 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)
+ for i=1,#methods do
+ local method=methods[i]
+ local exporter=exporters[method]
+ if exporter then
+ local result=exporter(t,method)
+ if result and result~="" then
+ if filename then
+ local fullname=file.replacesuffix(filename,method)
+ t.report("saving export in %a",fullname)
+ io.savedata(fullname,result)
+ else
+ reporters.lines(t,result)
+ end
else
- reporters.lines(t,result)
+ t.report("no output from exporter %a",method)
end
+ else
+ t.report("unknown exporter %a",method)
end
end
end
@@ -15614,8 +15623,8 @@ end -- of closure
-- used libraries : l-lua.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 644433
--- stripped bytes : 232542
+-- original bytes : 644822
+-- stripped bytes : 232608
-- end library merge