add debug argument to reader.lua

Without -d argument, all the debug message will
be suppressed.
pull/2/merge
Qingping Hou 12 years ago
parent c46266fee8
commit c4bd2a1046

@ -33,7 +33,7 @@ longopts = {
password = "p",
goto = "g",
gamma = "G",
device = "d",
debug = "d",
help = "h"
}
@ -71,6 +71,7 @@ function showusage()
print("-p, --password=PASSWORD set password for reading PDF document")
print("-g, --goto=page start reading on page")
print("-G, --gamma=GAMMA set gamma correction")
print("-d, --debug start in debug mode")
print(" (floating point notation, e.g. \"1.5\")")
print("-h, --help show this usage help")
print("")
@ -84,11 +85,19 @@ function showusage()
return
end
optarg, optind = alt_getopt.get_opts(ARGV, "p:G:hg:d:", longopts)
optarg, optind = alt_getopt.get_opts(ARGV, "p:g:G:hg:dg:", longopts)
if optarg["h"] then
return showusage()
end
if not optarg["d"] then
debug = function() end
end
if optarg["G"] ~= nil then
globalgamma = optarg["G"]
end
if util.isEmulated()==1 then
input.open("")
-- SDL key codes
@ -107,10 +116,6 @@ else
end
end
if optarg["G"] ~= nil then
globalgamma = optarg["G"]
end
fb = einkfb.open("/dev/fb0")
G_width, G_height = fb:getSize()
-- read current rotation mode

Loading…
Cancel
Save