lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


sure, command line arguments are in the global table arg, see chapter 6 of
the manual for an example:

> lua -la.lua b.lua t1 t2

the interpreter first runs the file a.lua, then creates a table 
       arg = { [-2] = "lua", [-1] = "-la.lua", [0] = "b.lua",
               [1] = "t1", [2] = "t2"; n = 2 }


-----Ursprüngliche Nachricht-----
Von: lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br] Im Auftrag von Walter Cruz
Gesendet: Montag, 22. August 2005 23:22
An: lua@bazar2.conectiva.com.br
Betreff: lua as a scriptt - argc and argv

Hi. Can I write a lua script that gets the argc and argv from the
commandline ?

like :

lua script.lua parameter1

Is this possible ?

[]'s
- Walter