summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2014-07-13 12:30:27 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2014-07-13 12:30:27 +0200
commitc381ee8e456001a8ca4e9ceadda080e6a8c7386b (patch)
tree632d916197ce106c54a92dc7ebe96ddf61de6af0
parent992b0150c8182c10cd3415d696bf66c10a381dd7 (diff)
downloadluaotfload-c381ee8e456001a8ca4e9ceadda080e6a8c7386b.tar.gz
[tool] fix setting of verbosity
-rwxr-xr-xsrc/luaotfload-tool.lua21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/luaotfload-tool.lua b/src/luaotfload-tool.lua
index 7b61675..04237dd 100755
--- a/src/luaotfload-tool.lua
+++ b/src/luaotfload-tool.lua
@@ -753,9 +753,14 @@ action_pending.generate = false --- this is the default action
local actions = { } --- (jobspec -> (bool * bool)) list
actions.loglevel = function (job)
- log.set_loglevel(job.log_level)
- report ("info", 3, "util", "Setting the log level to %d.", job.log_level)
- report ("log", 2, "util", "Lua=%q", _VERSION)
+ local lvl = job.log_level
+ if lvl then
+ log.set_loglevel(lvl)
+ report ("info", 3, "util", "Setting the log level to %d.", lvl)
+ report ("log", 2, "util", "Lua=%q", _VERSION)
+ else
+ report ("info", 0, "util", "Invalid loglevel, ignoring.")
+ end
return true, true
end
@@ -1399,7 +1404,7 @@ local process_cmdline = function ( ) -- unit -> jobspec
warnings = false,
criterion = "",
query = "",
- log_level = 0, --- 2 is approx. the old behavior
+ log_level = nil,
bisect = nil,
config = { db = { }, misc = { }, run = { }, paths = { } },
}
@@ -1452,11 +1457,13 @@ local process_cmdline = function ( ) -- unit -> jobspec
elseif v == "u" then
action_pending["generate"] = true
elseif v == "v" then
- if result.log_level > 0 then
- result.log_level = result.log_level + 1
+ local lvl = result.log_level
+ if not lvl or lvl < 1 then
+ lvl = 1
else
- result.log_level = 1
+ lvl = lvl + 1
end
+ result.log_level = lvl
elseif v == "V" then
action_pending["version"] = true
elseif v == "h" then