Show version info in server log
This commit is contained in:
parent
9f0d81e7f1
commit
531abdafde
14
main.go
14
main.go
@ -100,9 +100,7 @@ func main() {
|
||||
flag.Parse()
|
||||
|
||||
if versionFlag != nil && *versionFlag {
|
||||
fmt.Printf("netgiv %s, built at %s\n", version, date)
|
||||
fmt.Printf("commit: %s\n", commit)
|
||||
fmt.Print("http://github.com/tardisx/netgiv\n")
|
||||
fmt.Print(versionInfo(true))
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
@ -212,3 +210,13 @@ environment variable. This may be preferable in some environments.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func versionInfo(verbose bool) string {
|
||||
out := ""
|
||||
out += fmt.Sprintf("netgiv %s, built at %s\n", version, date)
|
||||
if verbose {
|
||||
out += fmt.Sprintf("commit: %s\n", commit)
|
||||
out += fmt.Sprintf("http://github.com/tardisx/netgiv\n")
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user