mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
added --goto page comamnd-line argument
This commit is contained in:
@@ -35,16 +35,18 @@ KEY_BTN = 92
|
||||
-- option parsing:
|
||||
longopts = {
|
||||
password = "p",
|
||||
goto = "g",
|
||||
gamma = "G",
|
||||
device = "d",
|
||||
help = "h"
|
||||
}
|
||||
optarg, optind = alt_getopt.get_opts(ARGV, "p:G:h", longopts)
|
||||
optarg, optind = alt_getopt.get_opts(ARGV, "p:G:hg:", longopts)
|
||||
if optarg["h"] or ARGV[optind] == nil then
|
||||
print("usage: ./reader.lua [OPTION] ... DOCUMENT.PDF")
|
||||
print("Read PDFs on your E-Ink reader")
|
||||
print("")
|
||||
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(" (floating point notation, e.g. \"1.5\")")
|
||||
print("-d, --device=DEVICE set device specific configuration,")
|
||||
@@ -213,6 +215,6 @@ function mainloop()
|
||||
end
|
||||
end
|
||||
|
||||
goto(1)
|
||||
goto(tonumber(optarg["g"]) or 1)
|
||||
|
||||
mainloop()
|
||||
|
||||
Reference in New Issue
Block a user