summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-11-05 15:49:19 +0100
committerPhilipp Gesang <phg42.2a@gmail.com>2013-11-05 15:49:19 +0100
commitf07090bcb38819badfbef38e0f929aab57ee8501 (patch)
tree5d91cdf2622a1a89af8e343c00698a1e0988fe4b
parent847b5a1a519b3945a1734f5859a80d459e865457 (diff)
downloadluaotfload-f07090bcb38819badfbef38e0f929aab57ee8501.tar.gz
[tool] adapt ``--list``
-rwxr-xr-xluaotfload-tool.lua18
1 files changed, 13 insertions, 5 deletions
diff --git a/luaotfload-tool.lua b/luaotfload-tool.lua
index f9071d9..29d3a43 100755
--- a/luaotfload-tool.lua
+++ b/luaotfload-tool.lua
@@ -138,6 +138,7 @@ config.lualibs.load_extended = true
require "lualibs"
local tabletohash = table.tohash
+local stringsplit = string.split
--[[doc--
\fileent{luatex-basics-gen.lua} calls functions from the
@@ -882,14 +883,19 @@ end
local get_fields get_fields = function (entry, fields, acc, n)
if not acc then
- return get_fields(entry, fields, { }, 1)
+ return get_fields (entry, fields, { }, 1)
end
- local field = fields[n]
+ local field = fields [n]
if field then
- local value = entry[field]
+ local chain = stringsplit (field, "->")
+ local tmp = entry
+ for i = 1, #chain - 1 do
+ tmp = tmp [chain [i]]
+ end
+ local value = tmp [chain [#chain]]
acc[#acc+1] = value or false
- return get_fields(entry, fields, acc, n+1)
+ return get_fields (entry, fields, acc, n+1)
end
return acc
end
@@ -940,7 +946,7 @@ actions.list = function (job)
asked_fields = lpegmatch(splitcomma, asked_fields)
else
--- some defaults
- asked_fields = { "fullname", "version", }
+ asked_fields = { "names->fullname", "version", }
end
if not name_index then
@@ -1019,6 +1025,8 @@ actions.list = function (job)
end
end
+ texiowrite_nl ""
+
return true, true
end