lua-users home
lua-l archive

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


lua.c in 4.0 adds everything it doesn't consider to be an argument to the
arg table. However, it adds the filename passed to -f as arg[1], which is
rather annoying, because this is effectively the program name, so should
surely be arg[0] (?).

The reason it's annoying is that

lua -f foo.lua a b c     gives arg = {foo.lua, a, b, c}

but if you then make foo.lua into foo.c and compile that up, then

foo[.exe] a b c          gives arg = {a, b, c}

which messes up arg-parsing code.

-- 
http://www.mupsych.org/rrt/ | The Next Station Is Oval