comparison core/src/luan/cmd_line.luan @ 346:dc21bd260690

change cmd_line to take a URI
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 12 Apr 2015 06:54:14 -0600
parents db37d6aee4db
children b31d614343e8
comparison
equal deleted inserted replaced
345:c7b2ee4c6ee9 346:dc21bd260690
9 local print = Io.print 9 local print = Io.print
10 local Debug = require "luan:Debug" 10 local Debug = require "luan:Debug"
11 11
12 12
13 local standalone_usage = [=[ 13 local standalone_usage = [=[
14 usage: java luan.Luan [options] [script [args]] 14 usage: java luan.Luan [options] [script-URI [args]]
15 Available options are: 15 Available options are:
16 -e stat execute string 'stat' 16 -e stat execute string 'stat'
17 -i enter interactive mode after executing 'script' 17 -i enter interactive mode after executing 'script'
18 -v show version information 18 -v show version information
19 -- stop handling options 19 -- stop handling options
73 for j,v in ipairs(args) do 73 for j,v in ipairs(args) do
74 Luan.arg[j-i] = v 74 Luan.arg[j-i] = v
75 end 75 end
76 try { 76 try {
77 function() 77 function()
78 local main_file = load_file("file:"..file) 78 local main_file = load_file(file..".luan")
79 main_file( Table.unpack(Luan.arg) ) 79 main_file( Table.unpack(Luan.arg) )
80 end; 80 end;
81 catch = function(e) 81 catch = function(e)
82 Io.print_to(Io.stderr, e ) 82 Io.print_to(Io.stderr, e )
83 end; 83 end;