diff options
Diffstat (limited to 'scripts/context/lua/mtx-context.lua')
-rw-r--r-- | scripts/context/lua/mtx-context.lua | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/scripts/context/lua/mtx-context.lua b/scripts/context/lua/mtx-context.lua index f33363a0d..698a6f142 100644 --- a/scripts/context/lua/mtx-context.lua +++ b/scripts/context/lua/mtx-context.lua @@ -518,6 +518,7 @@ function scripts.context.run(ctxdata,filename) local a_purgeresult = getargument("purgeresult") local a_global = getargument("global") local a_timing = getargument("timing") + local a_profile = getargument("profile") local a_batchmode = getargument("batchmode") local a_nonstopmode = getargument("nonstopmode") local a_once = getargument("once") @@ -626,6 +627,22 @@ function scripts.context.run(ctxdata,filename) report("warning: synctex is enabled") -- can add upto 5% runtime end -- + if not a_timing then + -- okay + elseif c_flags.usemodule then + c_flags.usemodule = format("timing,%s",c_flags.usemodule) + else + c_flags.usemodule = "timing" + end + -- + if not a_profile then + -- okay + elseif c_flags.directives then + c_flags.directives = format("system.profile,%s",c_flags.directives) + else + c_flags.directives = "system.profile" + end + -- -- kindofrun: 1:first run, 2:successive run, 3:once, 4:last of maxruns -- for currentrun=1,maxnofruns do @@ -1371,10 +1388,6 @@ elseif getargument("runs") then multipass_nofruns = tonumber(getargument("runs")) or nil end -if getargument("profile") then - os.setenv("MTX_PROFILE_RUN","YES") -end - if getargument("run") then scripts.context.timed(scripts.context.autoctx) elseif getargument("make") then |