update version output

This commit is contained in:
AJ ONeal 2020-10-21 00:22:33 -06:00
parent d42763516f
commit f275cd82d3
1 changed files with 5 additions and 4 deletions

View File

@ -20,7 +20,8 @@ var (
) )
func usage() { func usage() {
ver() fmt.Println(ver())
fmt.Println()
fmt.Println("Usage") fmt.Println("Usage")
fmt.Printf(" %s <command> [flags] args...\n", name) fmt.Printf(" %s <command> [flags] args...\n", name)
fmt.Println("") fmt.Println("")
@ -43,8 +44,8 @@ func usage() {
fmt.Println("") fmt.Println("")
} }
func ver() { func ver() string {
fmt.Printf("%s v%s %s (%s)\n", name, version, commit[:7], date) return fmt.Sprintf("%s v%s (%s) %s", name, version, commit[:7], date)
} }
func main() { func main() {
@ -65,7 +66,7 @@ func main() {
switch args[1] { switch args[1] {
case "version": case "version":
ver() fmt.Println(ver())
os.Exit(0) os.Exit(0)
return return
case "gen": case "gen":