summaryrefslogtreecommitdiff
path: root/src/luaotfload-tool.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2014-07-24 22:00:28 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2014-07-24 22:10:47 +0200
commiteb9d41d52ea5168284472a7290bce7a579ba1794 (patch)
treeab8d0b2ac65a98d2c21e321a78bfbee5f29f8609 /src/luaotfload-tool.lua
parent04dc6c632f7bc85b48d12af695392fb5e4d0faef (diff)
downloadluaotfload-eb9d41d52ea5168284472a7290bce7a579ba1794.tar.gz
[conf,tool] implement configuration writer
Now ``luaotfload-tool --dumpconf`` can be used to output the current configuration to a file.
Diffstat (limited to 'src/luaotfload-tool.lua')
-rwxr-xr-xsrc/luaotfload-tool.lua34
1 files changed, 23 insertions, 11 deletions
diff --git a/src/luaotfload-tool.lua b/src/luaotfload-tool.lua
index 754f5c7..02c5a45 100755
--- a/src/luaotfload-tool.lua
+++ b/src/luaotfload-tool.lua
@@ -6,7 +6,7 @@
-- AUTHOR: Khaled Hosny, Élie Roux, Philipp Gesang
-- VERSION: 2.5
-- LICENSE: GPL v2.0
--- MODIFIED: 2014-07-24 22:07:35+0200
+-- MODIFIED: 2014-07-24 22:10:32+0200
-----------------------------------------------------------------------
luaotfload = luaotfload or { }
@@ -739,9 +739,10 @@ set.
--]]--
local action_sequence = {
- "config", "loglevel", "help", "version",
- "diagnose", "blacklist", "cache", "flush",
- "bisect", "generate", "list", "query",
+ "config" , "loglevel" , "help" , "version" ,
+ "dumpconf" , "diagnose" , "blacklist" , "cache" ,
+ "flush" , "bisect" , "generate" , "list" ,
+ "query" ,
}
local action_pending = tabletohash(action_sequence, false)
@@ -781,6 +782,11 @@ actions.version = function (job)
return true, false
end
+actions.dumpconf = function (job)
+ config.actions.dump ()
+ return true, false
+end
+
actions.help = function (job)
help_msg (job.help_version or "luaotfload-tool")
return true, false
@@ -1413,6 +1419,7 @@ local process_cmdline = function ( ) -- unit -> jobspec
cache = 1,
conf = 1,
diagnose = 1,
+ dumpconf = 0,
["dry-run"] = "D",
["flush-lookups"] = "l",
fields = 1,
@@ -1551,15 +1558,20 @@ local process_cmdline = function ( ) -- unit -> jobspec
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
+ local confname = optarg[n]
+ if confname 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
end
+ elseif v == "dumpconf" then
+ action_pending["dumpconf"] = true
elseif v == "print-conf" then
result.print_config = true
end