summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/context/lua/mtx-convert.lua
diff options
context:
space:
mode:
authorTaco Hoekwater <taco@elvenkind.com>2011-06-01 08:54:21 +0000
committerTaco Hoekwater <taco@elvenkind.com>2011-06-01 08:54:21 +0000
commitd7ccb42582f85acf30568913610ccf4d602023fb (patch)
tree7292e3545a420676878e7451b68892d360c62cb6 /Master/texmf-dist/scripts/context/lua/mtx-convert.lua
parent2d62a6fe9b80def59c392268022f1f9a2d6e358f (diff)
commit context 2011.05.18
git-svn-id: svn://tug.org/texlive/trunk@22719 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/context/lua/mtx-convert.lua')
-rw-r--r--Master/texmf-dist/scripts/context/lua/mtx-convert.lua33
1 files changed, 19 insertions, 14 deletions
diff --git a/Master/texmf-dist/scripts/context/lua/mtx-convert.lua b/Master/texmf-dist/scripts/context/lua/mtx-convert.lua
index 62198a62188..0c5c01bbfbe 100644
--- a/Master/texmf-dist/scripts/context/lua/mtx-convert.lua
+++ b/Master/texmf-dist/scripts/context/lua/mtx-convert.lua
@@ -8,6 +8,23 @@ if not modules then modules = { } end modules ['mtx-convert'] = {
-- todo: eps and svg
+local helpinfo = [[
+--convertall convert all graphics on path
+--inputpath=string original graphics path
+--outputpath=string converted graphics path
+--watch watch folders
+--force force conversion (even if older)
+--delay time between sweeps
+]]
+
+local application = logs.application {
+ name = "mtx-convert",
+ banner = "ConTeXT Graphic Conversion Helpers 0.10",
+ helpinfo = helpinfo,
+}
+
+local report = application.report
+
graphics = graphics or { }
graphics.converters = graphics.converters or { }
@@ -40,7 +57,7 @@ local function convert(kind,oldname,newname)
if graphics.converters[kind] then -- extra test
local tmpname = file.replacesuffix(newname,"tmp")
local command = graphics.converters[kind](oldname,tmpname)
- logs.simple("command: %s",command)
+ report("command: %s",command)
io.flush()
os.spawn(command)
os.remove(newname)
@@ -118,22 +135,10 @@ function scripts.convert.convertgiven()
end
end
-
-logs.extendbanner("ConTeXT Graphic Conversion Helpers 0.10",true)
-
-messages.help = [[
---convertall convert all graphics on path
---inputpath=string original graphics path
---outputpath=string converted graphics path
---watch watch folders
---force force conversion (even if older)
---delay time between sweeps
-]]
-
if environment.argument("convertall") then
scripts.convert.convertall()
elseif environment.files[1] then
scripts.convert.convertgiven()
else
- logs.help(messages.help)
+ application.help()
end