mirror of https://github.com/Hilbis/Hilbish
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 2pull/143/head
parent
194e4e01b7
commit
e3fdf84f5c
2
main.go
2
main.go
|
@ -155,7 +155,7 @@ func main() {
|
||||||
if getopt.NArgs() > 0 {
|
if getopt.NArgs() > 0 {
|
||||||
luaArgs := rt.NewTable()
|
luaArgs := rt.NewTable()
|
||||||
for i, arg := range getopt.Args() {
|
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))
|
l.GlobalEnv().Set(rt.StringValue("args"), rt.TableValue(luaArgs))
|
||||||
|
|
Loading…
Reference in New Issue