summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/context/lua/mtx-metatex.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/scripts/context/lua/mtx-metatex.lua')
-rw-r--r--Master/texmf-dist/scripts/context/lua/mtx-metatex.lua43
1 files changed, 19 insertions, 24 deletions
diff --git a/Master/texmf-dist/scripts/context/lua/mtx-metatex.lua b/Master/texmf-dist/scripts/context/lua/mtx-metatex.lua
index 4453e2ccb47..0b66d59ef3a 100644
--- a/Master/texmf-dist/scripts/context/lua/mtx-metatex.lua
+++ b/Master/texmf-dist/scripts/context/lua/mtx-metatex.lua
@@ -8,39 +8,41 @@ if not modules then modules = { } end modules ['mtx-metatex'] = {
-- future versions will deal with specific variants of metatex
+local helpinfo = [[
+--run process (one or more) files (default action)
+--make create metatex format(s)
+]]
+
+local application = logs.application {
+ name = "mtx-metatex",
+ banner = "MetaTeX Process Management 0.10",
+ helpinfo = helpinfo,
+}
+
+local report = application.report
+
scripts = scripts or { }
scripts.metatex = scripts.metatex or { }
-- metatex
function scripts.metatex.make()
- local command = "luatools --make --compile metatex"
- logs.simple("running command: %s",command)
- os.spawn(command)
+ environment.make_format("metatex")
end
---~ function scripts.metatex.run()
---~ local name = environment.files[1] or ""
---~ if name ~= "" then
---~ local command = "luatools --fmt=metatex " .. name
---~ logs.simple("running command: %s",command)
---~ os.spawn(command)
---~ end
---~ end
-
function scripts.metatex.run(ctxdata,filename)
local filename = environment.files[1] or ""
if filename ~= "" then
- local formatfile, scriptfile = resolvers.locate_format("metatex")
+ local formatfile, scriptfile = resolvers.locateformat("metatex")
if formatfile and scriptfile then
local command = string.format("luatex --fmt=%s --lua=%s %s",
string.quote(formatfile), string.quote(scriptfile), string.quote(filename))
- logs.simple("running command: %s",command)
+ report("running command: %s",command)
os.spawn(command)
elseif formatname then
- logs.simple("error, no format found with name: %s",formatname)
+ report("error, no format found with name: %s",formatname)
else
- logs.simple("error, no format found (provide formatname or interface)")
+ report("error, no format found (provide formatname or interface)")
end
end
end
@@ -49,13 +51,6 @@ function scripts.metatex.timed(action)
statistics.timed(action)
end
-logs.extendbanner("MetaTeX Process Management 0.10",true)
-
-messages.help = [[
---run process (one or more) files (default action)
---make create metatex format(s)
-]]
-
if environment.argument("run") then
scripts.metatex.timed(scripts.metatex.run)
elseif environment.argument("make") then
@@ -65,5 +60,5 @@ elseif environment.argument("help") then
elseif environment.files[1] then
scripts.metatex.timed(scripts.metatex.run)
else
- logs.help(messages.help,false)
+ application.help()
end