summaryrefslogtreecommitdiff
path: root/src/luaotfload-tool.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2014-02-14 22:41:20 +0100
committerPhilipp Gesang <phg42.2a@gmail.com>2014-02-14 22:41:20 +0100
commit54269ef7c476dc4952ea2e6c08b6e2bfa9f68ba5 (patch)
treec9bd222c5bf02d030921a458c30d30b5498382cc /src/luaotfload-tool.lua
parent0c7e35163064e7d40cddbad129745060d9666ee6 (diff)
downloadluaotfload-54269ef7c476dc4952ea2e6c08b6e2bfa9f68ba5.tar.gz
[db,tool] support scanning local fonts into db
Diffstat (limited to 'src/luaotfload-tool.lua')
-rwxr-xr-xsrc/luaotfload-tool.lua20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/luaotfload-tool.lua b/src/luaotfload-tool.lua
index 01d0361..9f00956 100755
--- a/src/luaotfload-tool.lua
+++ b/src/luaotfload-tool.lua
@@ -723,9 +723,9 @@ set.
--]]--
local action_sequence = {
- "loglevel", "help", "version", "diagnose",
- "blacklist", "cache", "flush", "generate",
- "list", "query",
+ "loglevel", "help", "version", "diagnose",
+ "blacklist", "cache", "flush", "generate",
+ "scan_local", "list", "query",
}
local action_pending = tabletohash(action_sequence, false)
@@ -762,8 +762,7 @@ actions.blacklist = function (job)
end
actions.generate = function (job)
- local fontnames, savedname
- fontnames = names.update(fontnames, job.force_reload, job.dry_run)
+ local fontnames = names.update(fontnames, job.force_reload, job.dry_run)
report ("info", 2, "db", "Fonts in the database: %i", #fontnames.mappings)
if names.data() then
return true, true
@@ -771,6 +770,11 @@ actions.generate = function (job)
return false, false
end
+actions.scan_local = function (job)
+ names.scan_local_fonts ()
+ return true, true
+end
+
actions.flush = function (job)
local success = names.flush_lookup_cache()
if success then
@@ -1094,6 +1098,7 @@ local process_cmdline = function ( ) -- unit -> jobspec
inspect = "I",
limit = 1,
list = 1,
+ ["local"] = "L",
log = 1,
["max-fonts"] = 1,
["no-reload"] = "n",
@@ -1109,7 +1114,7 @@ local process_cmdline = function ( ) -- unit -> jobspec
warnings = "w",
}
- local short_options = "bcDfFiIlnpqRSuvVhw"
+ local short_options = "bcDfFiIlLnpqRSuvVhw"
local options, _, optarg =
alt_getopt.get_ordered_opts (arg, short_options, long_options)
@@ -1167,6 +1172,9 @@ local process_cmdline = function ( ) -- unit -> jobspec
result.full_info = true
elseif v == "l" then
action_pending["flush"] = true
+ elseif v == "L" then
+ action_pending["generate"] = true
+ action_pending["scan_local"] = true
elseif v == "list" then
action_pending["list"] = true
result.criterion = optarg[n]