2019-01-10 00:49:50 +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
|
|
|
"github.com/d5/tengo/stdlib"
|
2019-01-10 00:49:50 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2019-03-16 23:58:08 +03:00
|
|
|
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")
|
2019-01-30 12:21:26 +03:00
|
|
|
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() {
|
2019-03-16 23:58:08 +03:00
|
|
|
cli.Run(&cli.Options{
|
2019-03-18 18:15:26 +03:00
|
|
|
ShowHelp: showHelp,
|
|
|
|
ShowVersion: showVersion,
|
|
|
|
Version: version,
|
|
|
|
CompileOutput: compileOutput,
|
2019-03-20 11:28:40 +03:00
|
|
|
Modules: stdlib.GetModuleMap(stdlib.AllModuleNames()...),
|
2019-03-18 18:15:26 +03:00
|
|
|
InputFile: flag.Arg(0),
|
2019-03-16 23:58:08 +03:00
|
|
|
})
|
2019-01-10 00:49:50 +03:00
|
|
|
}
|