comparison core/src/luan/cmd_line.luan @ 313:1f6d828986b9

replace Http.request.servlet_path with Http.request.path; rename Http.request.current_url to Http.request.url; Web_server now loads welcome_file in init() for initialization; fix cmd_line -e; fix install for luan args; git-svn-id: https://luan-java.googlecode.com/svn/trunk@314 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Thu, 25 Dec 2014 06:14:59 +0000
parents 9fb523472035
children fed1893821bf
comparison
equal deleted inserted replaced
312:d34be4588556 313:1f6d828986b9
3 import "luan:Io" 3 import "luan:Io"
4 import "luan:Debug" 4 import "luan:Debug"
5 5
6 6
7 local standalone_usage = [=[ 7 local standalone_usage = [=[
8 usage: java luan.CmdLine [options] [script [args]] 8 usage: java luan.Luan [options] [script [args]]
9 Available options are: 9 Available options are:
10 -e stat execute string 'stat' 10 -e stat execute string 'stat'
11 -i enter interactive mode after executing 'script' 11 -i enter interactive mode after executing 'script'
12 -v show version information 12 -v show version information
13 -- stop handling options 13 -- stop handling options
36 interactive = true 36 interactive = true
37 elseif arg == "-v" then 37 elseif arg == "-v" then
38 showVersion = true 38 showVersion = true
39 elseif arg == "-e" then 39 elseif arg == "-e" then
40 i = i + 1 40 i = i + 1
41 if i == #args then 41 if i > #args then
42 standalone_error "'-e' needs argument" 42 standalone_error "'-e' needs argument"
43 return 43 return
44 end 44 end
45 local cmd = args[i] 45 local cmd = args[i]
46 local stat = load(cmd,"(command line)",true,true) 46 local stat = load(cmd,"(command line)",{},true)
47 local result = Table.pack( stat() ) 47 local result = Table.pack( stat() )
48 if result.n > 0 then 48 if result.n > 0 then
49 print( Table.unpack(result,1,result.n) ) 49 print( Table.unpack(result,1,result.n) )
50 end 50 end
51 elseif arg == "-" then 51 elseif arg == "-" then