diff options
Diffstat (limited to 'scripts/context/lua/mtxlibs.lua')
-rw-r--r-- | scripts/context/lua/mtxlibs.lua | 26 |
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() |