aboutsummaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
Diffstat (limited to 'samples')
-rw-r--r--samples/lpr.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/samples/lpr.lua b/samples/lpr.lua
index 77c354f..c23ebee 100644
--- a/samples/lpr.lua
+++ b/samples/lpr.lua
@@ -1,7 +1,7 @@
1local lp = require("lp") 1local lp = require("lp")
2 2
3local function usage() 3local function usage()
4 print('\nUsage: lp filename [keyword=val...]\n') 4 print('\nUsage: lua lptest.lua [filename] [keyword=val...]\n')
5 print('Valid keywords are :') 5 print('Valid keywords are :')
6 print( 6 print(
7 ' host=remote host or IP address (default "localhost")\n' .. 7 ' host=remote host or IP address (default "localhost")\n' ..
@@ -36,12 +36,13 @@ do
36 if not arg[2] then 36 if not arg[2] then
37 return usage() 37 return usage()
38 end 38 end
39
39 if arg[1] ~= "query" then 40 if arg[1] ~= "query" then
40 r,e=lp.send(arg[1],opt) 41 r,e=lp.send(arg[1],opt)
41 io.stderr:write(tostring(r or e),'\n') 42 io.stdout:write(tostring(r or e),'\n')
42 else 43 else
43 r,e=lp.query(opt) 44 r,e=lp.query(opt)
44 io.stderr:write(tostring(r or e), '\n') 45 io.stdout:write(tostring(r or e), '\n')
45 end 46 end
46end 47end
47 48