mirror of
https://github.com/ehang-io/nps.git
synced 2026-11-01 01:02:12 +08:00
add print version
This commit is contained in:
1 parent
f1ae3ca758
commit
b6d6fedca2
4 files changed
+22
-1
No files matched your search
@@ -37,6 +37,7 @@ var (
|
||||
debug = flag.Bool("debug", true, "npc debug")
|
||||
pprofAddr = flag.String("pprof", "", "PProf debug addr (ip:port)")
|
||||
stunAddr = flag.String("stun_addr", "stun.stunprotocol.org:3478", "stun server address (eg:stun.stunprotocol.org:3478)")
|
||||
ver = flag.Bool("version", false, "show current version")
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -44,6 +45,10 @@ func main() {
|
||||
logs.Reset()
|
||||
logs.EnableFuncCallDepth(true)
|
||||
logs.SetLogFuncCallDepth(3)
|
||||
if *ver {
|
||||
common.PrintVersion()
|
||||
return
|
||||
}
|
||||
if *logPath == "" {
|
||||
*logPath = common.GetNpcLogPath()
|
||||
}
|
||||
|
||||
@@ -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())
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user