diff options
author | Hans Hagen <pragma@wxs.nl> | 2009-08-07 11:22:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2009-08-07 11:22:00 +0200 |
commit | c2fda456f975562068e66deb9905a9721af82ddf (patch) | |
tree | 845606dc5a889ad3a064e2147bfb7705e5fe843e /scripts | |
parent | 3edfc2fc3e569201a16c63871aae121e57673539 (diff) | |
download | context-c2fda456f975562068e66deb9905a9721af82ddf.tar.gz |
beta 2009.08.07 11:22
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/context/lua/mtx-server-ctx-fonttest.lua | 4 | ||||
-rw-r--r-- | scripts/context/lua/mtxrun.lua | 24 | ||||
-rw-r--r-- | scripts/context/stubs/mswin/mtxrun.lua | 24 | ||||
-rwxr-xr-x | scripts/context/stubs/unix/mtxrun | 24 |
4 files changed, 62 insertions, 14 deletions
diff --git a/scripts/context/lua/mtx-server-ctx-fonttest.lua b/scripts/context/lua/mtx-server-ctx-fonttest.lua index efaae66e3..f593c2e35 100644 --- a/scripts/context/lua/mtx-server-ctx-fonttest.lua +++ b/scripts/context/lua/mtx-server-ctx-fonttest.lua @@ -153,7 +153,7 @@ local function showfeatures(f) if not features then logs.simple("building cache for '%s'",f) io.savedata(file.join(temppath,file.addsuffix(tempname,"tex")),format(process_templates.cache,f,f)) - os.execute(format("mtxrun --path=%s --script context --once --batchmode --mode=*nofonts %s",temppath,tempname)) + os.execute(format("mtxrun --path=%s --script context --once --batchmode %s",temppath,tempname)) features = fonts.get_features(f) end cache[f] = features or false @@ -332,7 +332,7 @@ local function process_font(currentfont,detail) -- maybe just fontname if sample == "" then sample = sample_line end logs.simple("sample text: %s",sample) io.savedata(file.join(temppath,file.addsuffix(tempname,"tex")),format(variant,concat(features,","),currentfont,sample)) - os.execute(format("mtxrun --path=%s --script context --once --batchmode --mode=*nofonts %s",temppath,tempname)) + os.execute(format("mtxrun --path=%s --script context --once --batchmode %s",temppath,tempname)) return edit_font(currentfont,detail,tempname) end diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index d30350ea5..aba22a16e 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -10058,13 +10058,29 @@ function runners.execute_ctx_script(filename,arguments) end else logs.setverbose(true) - filename = file.addsuffix(filename,"lua") if filename == "" then logs.simple("unknown script, no name given") - elseif file.is_qualified_path(filename) then - logs.simple("unknown script '%s'",filename) + local context = resolvers.find_file("mtx-context.lua") + if context ~= "" then + local result = dir.glob((string.gsub(context,"mtx%-context","mtx-*"))) -- () needed + local valid = { } + for _, scriptname in ipairs(result) do + scriptname = string.match(scriptname,".*mtx%-([^%-]-)%.lua") + if scriptname then + valid[#valid+1] = scriptname + end + end + if #valid > 0 then + logs.simple("known scripts: %s",table.concat(valid,", ")) + end + end else - logs.simple("unknown script '%s' or 'mtx-%s'",filename,filename) + filename = file.addsuffix(filename,"lua") + if file.is_qualified_path(filename) then + logs.simple("unknown script '%s'",filename) + else + logs.simple("unknown script '%s' or 'mtx-%s'",filename,filename) + end end return false end diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index d30350ea5..aba22a16e 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -10058,13 +10058,29 @@ function runners.execute_ctx_script(filename,arguments) end else logs.setverbose(true) - filename = file.addsuffix(filename,"lua") if filename == "" then logs.simple("unknown script, no name given") - elseif file.is_qualified_path(filename) then - logs.simple("unknown script '%s'",filename) + local context = resolvers.find_file("mtx-context.lua") + if context ~= "" then + local result = dir.glob((string.gsub(context,"mtx%-context","mtx-*"))) -- () needed + local valid = { } + for _, scriptname in ipairs(result) do + scriptname = string.match(scriptname,".*mtx%-([^%-]-)%.lua") + if scriptname then + valid[#valid+1] = scriptname + end + end + if #valid > 0 then + logs.simple("known scripts: %s",table.concat(valid,", ")) + end + end else - logs.simple("unknown script '%s' or 'mtx-%s'",filename,filename) + filename = file.addsuffix(filename,"lua") + if file.is_qualified_path(filename) then + logs.simple("unknown script '%s'",filename) + else + logs.simple("unknown script '%s' or 'mtx-%s'",filename,filename) + end end return false end diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index d30350ea5..aba22a16e 100755 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -10058,13 +10058,29 @@ function runners.execute_ctx_script(filename,arguments) end else logs.setverbose(true) - filename = file.addsuffix(filename,"lua") if filename == "" then logs.simple("unknown script, no name given") - elseif file.is_qualified_path(filename) then - logs.simple("unknown script '%s'",filename) + local context = resolvers.find_file("mtx-context.lua") + if context ~= "" then + local result = dir.glob((string.gsub(context,"mtx%-context","mtx-*"))) -- () needed + local valid = { } + for _, scriptname in ipairs(result) do + scriptname = string.match(scriptname,".*mtx%-([^%-]-)%.lua") + if scriptname then + valid[#valid+1] = scriptname + end + end + if #valid > 0 then + logs.simple("known scripts: %s",table.concat(valid,", ")) + end + end else - logs.simple("unknown script '%s' or 'mtx-%s'",filename,filename) + filename = file.addsuffix(filename,"lua") + if file.is_qualified_path(filename) then + logs.simple("unknown script '%s'",filename) + else + logs.simple("unknown script '%s' or 'mtx-%s'",filename,filename) + end end return false end |