summaryrefslogtreecommitdiff
path: root/src/luaotfload-tool.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2014-04-21 21:40:21 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2014-04-21 21:40:21 +0200
commita84ec1cd4b7cc06fec1d2cf5e5f5e0cbd9115637 (patch)
tree05c63b5fd96f66a1874e081ac4239db6b1655896 /src/luaotfload-tool.lua
parent70a6425e1b6041d5c476117fa7c5a3acb9bc386a (diff)
downloadluaotfload-a84ec1cd4b7cc06fec1d2cf5e5f5e0cbd9115637.tar.gz
[conf,tool] integrate configuration parser
Diffstat (limited to 'src/luaotfload-tool.lua')
-rwxr-xr-xsrc/luaotfload-tool.lua41
1 files changed, 33 insertions, 8 deletions
diff --git a/src/luaotfload-tool.lua b/src/luaotfload-tool.lua
index 1923040..5893d42 100755
--- a/src/luaotfload-tool.lua
+++ b/src/luaotfload-tool.lua
@@ -45,7 +45,6 @@ kpse.set_program_name "luatex"
--doc]]--
-local ioopen = io.open
local iowrite = io.write
local kpsefind_file = kpse.find_file
local mathfloor = math.floor
@@ -149,7 +148,8 @@ texio.write, texio.write_nl = backup.write, backup.write_nl
utilities = backup.utilities
require"luaotfload-log.lua" --- this populates the luaotfload.log.* namespace
-require"luaotfload-parsers" --- fonts.conf and request syntax
+require"luaotfload-parsers" --- fonts.conf, configuration, and request syntax
+require"luaotfload-configuration" --- configuration file handling
require"luaotfload-database"
require"alt_getopt"
@@ -736,13 +736,14 @@ set.
--]]--
local action_sequence = {
- "loglevel", "help", "version", "diagnose",
- "blacklist", "cache", "flush", "bisect",
- "generate", "list", "query",
+ "loglevel", "config", "help", "version",
+ "diagnose", "blacklist", "cache", "flush",
+ "bisect", "generate", "list", "query",
}
local action_pending = tabletohash(action_sequence, false)
+action_pending.config = true --- always read the configuration
action_pending.loglevel = true --- always set the loglevel
action_pending.generate = false --- this is the default action
@@ -755,6 +756,16 @@ actions.loglevel = function (job)
return true, true
end
+actions.config = function (job)
+ local config = luaotfload.config.read (job.extra_config)
+ --if job.print_config == true then
+ if true then
+ -- inspect (config)
+ return true, false
+ end
+ return true, true
+end
+
actions.version = function (job)
version_msg()
return true, false
@@ -1386,8 +1397,9 @@ local process_cmdline = function ( ) -- unit -> jobspec
}
local long_options = {
+ ["bisect"] = 1,
cache = 1,
- ["no-compress"] = "c",
+ conf = 1,
diagnose = 1,
["dry-run"] = "D",
["flush-lookups"] = "l",
@@ -1404,11 +1416,12 @@ local process_cmdline = function ( ) -- unit -> jobspec
["local"] = "L",
log = 1,
["max-fonts"] = 1,
- ["bisect"] = 1,
+ ["no-compress"] = "c",
["no-reload"] = "n",
["no-strip"] = 0,
["skip-read"] = "R",
["prefer-texmf"] = "p",
+ ["print-conf"] = 0,
quiet = "q",
["show-blacklist"] = "b",
stats = "S",
@@ -1520,8 +1533,20 @@ local process_cmdline = function ( ) -- unit -> jobspec
end
end
elseif v == "bisect" then
- result.bisect = optarg[n]
+ result.bisect = optarg[n]
action_pending.bisect = true
+ elseif v == "conf" then
+ local extra = stringexplode (optarg[n], ",+")
+ if extra then
+ local extra_config = result.extra_config
+ if extra_config then
+ table.append (extra_config, extra)
+ else
+ result.extra_config = extra
+ end
+ end
+ elseif v == "print-conf" then
+ result.print_config = true
end
end