From 54269ef7c476dc4952ea2e6c08b6e2bfa9f68ba5 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 14 Feb 2014 22:41:20 +0100 Subject: [db,tool] support scanning local fonts into db --- src/luaotfload-tool.lua | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/luaotfload-tool.lua') 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] -- cgit v1.2.3