2019-03-04 21:21:39 +03:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"flag"
|
|
|
|
|
2019-03-16 23:58:08 +03:00
|
|
|
"github.com/d5/tengo/cli"
|
2019-03-04 21:21:39 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
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() {
|
2019-03-16 23:58:08 +03:00
|
|
|
cli.Run(&cli.Options{
|
|
|
|
ShowHelp: showHelp,
|
|
|
|
ShowVersion: showVersion,
|
|
|
|
Version: version,
|
|
|
|
CompileOutput: compileOutput,
|
|
|
|
InputFile: flag.Arg(0),
|
|
|
|
})
|
2019-03-04 21:21:39 +03:00
|
|
|
}
|