add print version

This commit is contained in:
ffdfgdfg
2020-03-05 23:49:24 +08:00
parent f1ae3ca758
commit b6d6fedca2
4 changed files with 22 additions and 1 deletions

View File

@@ -28,11 +28,16 @@ import (
var (
level string
ver = flag.Bool("version", false, "show current version")
)
func main() {
flag.Parse()
// init log
if *ver {
common.PrintVersion()
return
}
if err := beego.LoadAppConfig("ini", filepath.Join(common.GetRunPath(), "conf", "nps.conf")); err != nil {
log.Fatalln("load config file error", err.Error())
}