xgo/cmd/tengo/main.go

34 lines
650 B
Go
Raw Normal View History

2019-01-10 00:49:50 +03:00
package main
import (
"flag"
"github.com/d5/tengo/cli"
"github.com/d5/tengo/stdlib"
2019-01-10 00:49:50 +03:00
)
var (
compileOutput string
showHelp bool
showVersion bool
version = "dev"
2019-01-10 00:49:50 +03:00
)
func init() {
2019-01-13 04:02:15 +03:00
flag.BoolVar(&showHelp, "help", false, "Show help")
flag.StringVar(&compileOutput, "o", "", "Compile output file")
flag.BoolVar(&showVersion, "version", false, "Show version")
2019-01-10 00:49:50 +03:00
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),
})
2019-01-10 00:49:50 +03:00
}