_G.arg
RGFTheCoder opened this issue ยท 3 comments
Useful information to include:
- Simply does the equvalent of adding the line
_G.arg = { ... }
to the top of files run in the shell/ shell.run. - This is useful as it allows haxe programs compiled with the vanilla lua flag to run without modification. Currently one has to add the
_G.arg = { ... }
line to the top of the haxe program for it to run in cctweaked. - This functionality exists in the regular lua cli.
This functionality already exists, does it not? However it should be _ENV.arg
, because each program is run in its own environment.
Since the shell is also written in Lua, arg
would be persisted after each program run otherwise.
both should work since they both work in the lua cli. Try making this file in cctweaked and as a plain lua cli file
print(_G.arg[1])
print(_ENV.arg[1])
and run it like file.lua parameter
. Plain lua prints it fine (both times), but cctweaked fails cuz _G.arg
doesn't exist.