diff --git a/reader.lua b/reader.lua index 23f18fa51..9460672c5 100755 --- a/reader.lua +++ b/reader.lua @@ -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()