[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Standalone lua, stdin, and arguments
- From: Rici Lake <lua@...>
- Date: Tue, 11 Oct 2005 17:30:38 -0500
On 11-Oct-05, at 5:20 PM, David Burgess wrote:
In lua 5.1, while we are looking at lua.c and args
I think the creation of the "arg" variable should be guarded with
#ifdef LUA_COMPAT_VARARG
The arg variable gives you access to more things than ... does; for
example, you can extract the script name with arg[0]
$ cat argtest.lua
for k, v in pairs(arg) do print(k, v) end
$ lua51 argtest.lua a b c
1 a
2 b
3 c
0 argtest.lua
-1 lua51