@@ -73,7 +73,7 @@ exec lua "$0" "$@"
7373 --macrosuffix=suffix
7474 String to append to macro names.
7575
76- --meta
76+ --meta OR --meta=pathToSaveMetaprogramTo
7777 Output the metaprogram to a temporary file (*.meta.lua). Useful if
7878 an error happens when the metaprogram runs. This file is removed
7979 if there's no error and --debug isn't enabled.
@@ -203,7 +203,7 @@ local hasOutputExtension = false
203203local hasOutputPaths = false
204204local isDebug = false
205205local outputExtension = " lua"
206- local outputMeta = false
206+ local outputMeta = false -- flag|path
207207local processingInfoPath = " "
208208local silent = false
209209local validate = true
@@ -310,7 +310,7 @@ for _, arg in ipairs(args) do
310310
311311 elseif arg == " --debug" then
312312 isDebug = true
313- outputMeta = true
313+ outputMeta = outputMeta or true
314314
315315 elseif arg :find " ^%-%-handler=" or arg :find " ^%-h=" then
316316 messageHandlerPath = arg :gsub (" ^.-=" , " " )
@@ -323,6 +323,8 @@ for _, arg in ipairs(args) do
323323
324324 elseif arg == " --meta" then
325325 outputMeta = true
326+ elseif arg :find " ^%-%-meta=" then
327+ outputMeta = arg :gsub (" ^.-=" , " " )
326328
327329 elseif arg == " --nonil" then
328330 canOutputNil = false
@@ -516,7 +518,7 @@ for i, pathIn in ipairs(pathsIn) do
516518 printfNoise (" Processing '%s'..." , pathIn )
517519
518520 local pathOut = pathsOut [i ]
519- local pathMeta = pathOut :gsub (" %.%w+$" , " " ).. " .meta.lua"
521+ local pathMeta = ( type ( outputMeta ) == " string " ) and outputMeta or pathOut :gsub (" %.%w+$" , " " ).. " .meta.lua"
520522
521523 if not outputMeta or pathOut == " -" then
522524 pathMeta = nil
0 commit comments