2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-04-02 19:53:23 +00:00

fix: make table for args instead of using luar

This commit is contained in:
TorchedSammy 2021-12-06 16:32:34 -04:00
parent f60f61e616
commit eaaf17a792
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD

View File

@ -17,7 +17,6 @@ import (
"github.com/pborman/getopt"
"github.com/yuin/gopher-lua"
"golang.org/x/term"
"layeh.com/gopher-luar"
)
var (
@ -156,7 +155,12 @@ func main() {
}
if getopt.NArgs() > 0 {
l.SetGlobal("args", luar.New(l, getopt.Args()))
luaArgs := l.NewTable()
for _, arg := range getopt.Args() {
luaArgs.Append(lua.LString(arg))
}
l.SetGlobal("args", luaArgs)
err := l.DoFile(getopt.Arg(0))
if err != nil {
fmt.Fprintln(os.Stderr, err)