fix!: make path to script the 0th arg instead of 1st

makes more sense, brings some lua parity
this means that user passed args start from 1
instead of 2
pull/143/head
TorchedSammy 2022-04-13 20:19:28 -04:00
parent 194e4e01b7
commit e3fdf84f5c
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 1 additions and 1 deletions

View File

@ -155,7 +155,7 @@ func main() {
if getopt.NArgs() > 0 {
luaArgs := rt.NewTable()
for i, arg := range getopt.Args() {
luaArgs.Set(rt.IntValue(int64(i + 1)), rt.StringValue(arg))
luaArgs.Set(rt.IntValue(int64(i)), rt.StringValue(arg))
}
l.GlobalEnv().Set(rt.StringValue("args"), rt.TableValue(luaArgs))