mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
add debug argument to reader.lua
Without -d argument, all the debug message will be suppressed.
This commit is contained in:
17
reader.lua
17
reader.lua
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user