Skip to content

Commit 586804b

Browse files
committed
print version
1 parent 09c6043 commit 586804b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

cmd/new.go

+11
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,22 @@ import (
9999
var (
100100
GitHash = "None"
101101
BuildTS = "None"
102+
103+
ver bool
102104
)
103105
106+
func init() {
107+
flag.BoolVar(&ver, "v", false, "show version")
108+
}
109+
104110
func main() {
105111
flag.Parse()
106112
113+
if ver {
114+
fmt.Printf("GitHash: %s \nBuildTS: %s \n", GitHash, BuildTS)
115+
return
116+
}
117+
107118
app := service.NewWebApp()
108119
app.RegisterHook(service.ConfigHook, initConfig)
109120
app.RegisterHook(service.RouterHook, initRoute)

0 commit comments

Comments
 (0)