Mercurial Hosting > luan
diff core/src/luan/cmd_line.luan @ 320:fed1893821bf
remove global namespace
git-svn-id: https://luan-java.googlecode.com/svn/trunk@321 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Fri, 06 Feb 2015 21:54:41 +0000 |
parents | 1f6d828986b9 |
children | 7f7708e8fdd4 |
line wrap: on
line diff
--- a/core/src/luan/cmd_line.luan Thu Feb 05 21:55:49 2015 +0000 +++ b/core/src/luan/cmd_line.luan Fri Feb 06 21:54:41 2015 +0000 @@ -1,8 +1,13 @@ +import "luan:Luan" import "luan:String" import "luan:Table" import "luan:Io" import "luan:Debug" +local ipairs = Luan.ipairs +local load = Luan.load +local load_file = Luan.load_file + local standalone_usage = [=[ usage: java luan.Luan [options] [script [args]] @@ -63,13 +68,13 @@ if showVersion then print(_VERSION) end if i <= #args then local file = args[i] - _G.arg = {} + local arg = {} for j,v in ipairs(args) do - _G.arg[j-i] = v + arg[j-i] = v end try local main_file = load_file("file:"..file) - main_file( Table.unpack(_G.arg) ) + main_file( Table.unpack(arg) ) catch e do Io.print_to(Io.stderr, e ) end