xgo/cmd/tengo/main.go
Daniel 3c30109cd0
fix bytecode encoding/decoding of builtin modules (#154)
* fix bytecode encoding/decoding of builtin modules

* Bytecode.Decode() to take map[string]objects.Importable

* add objects.ModuleMap

* update docs

* stdlib.GetModuleMap()
2019-03-20 01:28:40 -07:00

33 lines
650 B
Go

package main
import (
"flag"
"github.com/d5/tengo/cli"
"github.com/d5/tengo/stdlib"
)
var (
compileOutput string
showHelp bool
showVersion bool
version = "dev"
)
func init() {
flag.BoolVar(&showHelp, "help", false, "Show help")
flag.StringVar(&compileOutput, "o", "", "Compile output file")
flag.BoolVar(&showVersion, "version", false, "Show version")
flag.Parse()
}
func main() {
cli.Run(&cli.Options{
ShowHelp: showHelp,
ShowVersion: showVersion,
Version: version,
CompileOutput: compileOutput,
Modules: stdlib.GetModuleMap(stdlib.AllModuleNames()...),
InputFile: flag.Arg(0),
})
}