summaryrefslogtreecommitdiff
path: root/scripts/context/lua/mtxlibs.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-03-22 19:57:53 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2018-03-22 19:57:53 +0100
commit5c46359f4fa543e24e5d4a0a327d41bf8a9ff7c8 (patch)
tree79fc6a0e161820ebb16a8830572868dcd0e1aae2 /scripts/context/lua/mtxlibs.lua
parentf47b4939787074397c9ea37c1d892a1f7ccc7290 (diff)
downloadcontext-5c46359f4fa543e24e5d4a0a327d41bf8a9ff7c8.tar.gz
2018-03-22 19:49:00
Diffstat (limited to 'scripts/context/lua/mtxlibs.lua')
-rw-r--r--scripts/context/lua/mtxlibs.lua26
1 files changed, 18 insertions, 8 deletions
diff --git a/scripts/context/lua/mtxlibs.lua b/scripts/context/lua/mtxlibs.lua
index bb0e03b17..f6839eb9d 100644
--- a/scripts/context/lua/mtxlibs.lua
+++ b/scripts/context/lua/mtxlibs.lua
@@ -68,7 +68,7 @@ local owntree = ownpath
local ownlibs = {
"l-lua.lua",
- "l-macros.lua",
+ "l-macro.lua",
"l-sandbox.lua",
"l-package.lua",
"l-lpeg.lua",
@@ -196,15 +196,13 @@ end
local arguments = environment.arguments
local files = environment.files
-if file.basename(environment.ownname) ~= "mtxlibs.lua" then
- return
-end
+local ownname = file.basename(environment.ownname)
local helpinfo = [[
usage: mtxlibs [options]
---merge
---merge targetfile extralibs
+--selfmerge
+--selfmerge targetfile extralibs
--selfclean
and in a lua file:
@@ -218,7 +216,19 @@ local application = logs.application {
helpinfo = helpinfo,
}
-local report = application.report
+local report = application.report
+
+if ownname == "mtxrun" or ownname == "mtxrun.lua" then
+ -- we're using mtxrun
+ ownname = "mtxlibs.lua"
+elseif ownname == "mtxlibs" or ownname == "mtxlibs.lua" then
+ -- we're using lua
+ ownname = "mtxlibs.lua"
+else
+ report("usage : lua mtxlibs.lua ...")
+ report(" : mtxrun --script mtxlibs.lua ...")
+ return
+end
if arguments.selfmerge then
@@ -247,7 +257,7 @@ elseif arguments.selfclean then
merger.selfclean(ownname)
report("done")
-elseif arguments.help or files[1] == "help" then
+else -- if arguments.help or files[1] == "help" then
application.help()