Open Arnaz87 opened 5 years ago
Example illustrating the issue:
init.lua
print("arg:", arg)
print("arg length:", #arg)
Executing torchbear
$ torchbear
arg: nil
2019-01-26 20:58:44 ERROR: init.lua:2: attempt to get length of a nil value (global 'arg')
stack traceback:
init.lua:2: in local 'init_f'
[string "?"]:15: in function <[string "?"]:11>
[C]: in function 'xpcall'
[string "?"]:11: in main chunk
Executing torchbear init.lua
(interpreter mode)
$ torchbear init.lua
arg: table: 0x5641b9f72b30
arg length: 1
When torchbear is run as
torchbear lua_script some_arg
(and also with a shebang), the lua global arg is set to{"lua_script", "some_arg"}
but when it's just the commandtorchbear
, arg is set to nil. It should be set to an empty table.