Add VersionString func to print out full app version

This commit is contained in:
Dan Sosedoff
2022-12-06 11:27:47 -06:00
parent 3e1a93296e
commit 97e41fbfe5
2 changed files with 22 additions and 15 deletions

View File

@@ -176,21 +176,7 @@ func initOptions() {
}
func printVersion() {
chunks := []string{fmt.Sprintf("Pgweb v%s", command.Version)}
if command.GitCommit != "" {
chunks = append(chunks, fmt.Sprintf("(git: %s)", command.GitCommit))
}
if command.GoVersion != "" {
chunks = append(chunks, fmt.Sprintf("(go: %s)", command.GoVersion))
}
if command.BuildTime != "" {
chunks = append(chunks, fmt.Sprintf("(build time: %s)", command.BuildTime))
}
fmt.Println(strings.Join(chunks, " "))
fmt.Println(command.VersionString())
}
func startServer() {