summaryrefslogtreecommitdiff
path: root/scripts/context/lua/mtx-metapost.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2013-03-21 15:00:17 +0200
committerMarius <mariausol@gmail.com>2013-03-21 15:00:17 +0200
commit6bb39561d4571fb85aac56a686b837a9f3c910cd (patch)
tree87f9b55ac771b742532fec258c637c0b15ec7dae /scripts/context/lua/mtx-metapost.lua
parent41df6a896ad3ab1d8bb6286423e9540b2b34f576 (diff)
downloadcontext-6bb39561d4571fb85aac56a686b837a9f3c910cd.tar.gz
beta 2013.03.21 13:42
Diffstat (limited to 'scripts/context/lua/mtx-metapost.lua')
-rw-r--r--scripts/context/lua/mtx-metapost.lua51
1 files changed, 36 insertions, 15 deletions
diff --git a/scripts/context/lua/mtx-metapost.lua b/scripts/context/lua/mtx-metapost.lua
index 44cf8205d..08daec978 100644
--- a/scripts/context/lua/mtx-metapost.lua
+++ b/scripts/context/lua/mtx-metapost.lua
@@ -7,19 +7,38 @@ if not modules then modules = { } end modules ['mtx-metapost'] = { -- this was m
}
local helpinfo = [[
---rawmp raw metapost run
---metafun use metafun instead of plain
---latex force --tex=latex
---texexec force texexec usage (mkii)
---split split single result file into pages
-
-intended usage:
-
-mtxrun --script metapost yourfile.mp
-mtxrun --script metapost --split yourfile.mp
-mtxrun --script metapost yourfile.123 myfile.mps
-
-other usage resembles mptopdf.pl
+<?xml version="1.0"?>
+<application>
+ <metadata>
+ <entry name="name">mtx-metapost</entry>
+ <entry name="detail">MetaPost to PDF processor</entry>
+ <entry name="version">0.10</entry>
+ </metadata>
+ <flags>
+ <category name="basic">
+ <subcategory>
+ <flag name="rawmp"><short>raw metapost run</short></flag>
+ <flag name="metafun"><short>use metafun instead of plain</short></flag>
+ <flag name="latex"><short>force <ref name="tex=latex"/></short></flag>
+ <flag name="texexec"><short>force texexec usage (mkii)</short></flag>
+ <flag name="split"><short>split single result file into pages</short></flag>
+ </subcategory>
+ </category>
+ </flags>
+ <examples>
+ <category>
+ <title>Examples</title>
+ <subcategory>
+ <example><command>mtxrun --script metapost yourfile.mp</command></example>
+ <example><command>mtxrun --script metapost --split yourfile.mp</command></example>
+ <example><command>mtxrun --script metapost yourfile.123 myfile.mps</command></example>
+ </subcategory>
+ </category>
+ </examples>
+ <comments>
+ <comment>other usage resembles mptopdf.pl</comment>
+ </comments>
+</application>
]]
local application = logs.application {
@@ -166,10 +185,12 @@ function scripts.mptopdf.convertall()
end
end
-if environment.files[1] then
+if environment.argument("exporthelp") then
+ application.export(environment.argument("exporthelp"),environment.files[1])
+elseif environment.files[1] then
scripts.mptopdf.convertall()
else
- if not environment.arguments.help then
+ if not environment.argument("help") then
report("provide MP output file (or pattern)")
report()
end