Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lua arg inconsistency #190

Open
Arnaz87 opened this issue Dec 29, 2018 · 1 comment
Open

lua arg inconsistency #190

Arnaz87 opened this issue Dec 29, 2018 · 1 comment

Comments

@Arnaz87
Copy link
Contributor

Arnaz87 commented Dec 29, 2018

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 command torchbear, arg is set to nil. It should be set to an empty table.

@sineemore
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants