mirror of https://github.com/Hilbis/Hilbish
fix: make table for `args` instead of using luar
parent
f60f61e616
commit
eaaf17a792
8
main.go
8
main.go
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue