Don't require config for --version

This commit is contained in:
Tulir Asokan 2020-06-03 20:47:13 +03:00
parent f3793309a0
commit 0f7163a294

18
main.go
View file

@ -370,15 +370,6 @@ func (bridge *Bridge) Main() {
} else if *migrateFrom {
bridge.MigrateDatabase()
return
} else if *version {
if Tag == Version {
fmt.Printf("%s %s (%s)\n", Name, Tag, BuildTime)
} else if len(Commit) > 8 {
fmt.Printf("%s %s.%s (%s)\n", Name, Version, Commit[:8], BuildTime)
} else {
fmt.Printf("%s %s+dev.unknown\n", Name, Version)
}
return
}
bridge.Init()
@ -408,6 +399,15 @@ func main() {
} else if *wantHelp {
flag.PrintHelp()
os.Exit(0)
} else if *version {
if Tag == Version {
fmt.Printf("%s %s (%s)\n", Name, Tag, BuildTime)
} else if len(Commit) > 8 {
fmt.Printf("%s %s.%s (%s)\n", Name, Version, Commit[:8], BuildTime)
} else {
fmt.Printf("%s %s.unknown\n", Name, Version)
}
return
}
NewBridge().Main()