From 372b225dc5f139b0988eb03032b571e0b91010eb Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Mon, 15 Feb 2010 16:58:38 +0200 Subject: Disable progress bar in verbose mode --- luaotfload-fonts.lua | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/luaotfload-fonts.lua b/luaotfload-fonts.lua index a79a18b..746b520 100644 --- a/luaotfload-fonts.lua +++ b/luaotfload-fonts.lua @@ -32,22 +32,24 @@ local function log(lvl, fmt, ...) end local function progress(current, total) --- local width = os.getenv("COLUMNS") -2 --doesn't work - local width = 78 - local percent = current/total - local gauge = format("[%s]", rep(" ", width)) - if percent >= 0.01 then - gauge = format("[%s>%s]", rep("=", (width*percent)-1), rep(" ", width-(width*percent))) - end - if percent == 1 then - gauge = gauge .. "\n" - end - if lastislog == 1 then - texio.write_nl("") - lastislog = 0 + if luaotfload.fonts.log_level == 1 then +-- local width = os.getenv("COLUMNS") -2 --doesn't work + local width = 78 + local percent = current/total + local gauge = format("[%s]", rep(" ", width)) + if percent > 0 then + gauge = format("[%s>%s]", rep("=", (width*percent)-1), rep(" ", width-(width*percent))) + end + if percent == 1 then + gauge = gauge .. "\n" + end + if lastislog == 1 then + texio.write_nl("") + lastislog = 0 + end + io.stderr:write("\r"..gauge) + io.stderr:flush() end - io.stderr:write("\r"..gauge) - io.stderr:flush() end function fontloader.fullinfo(...) -- cgit v1.2.3