Skip to content

Commit

Permalink
Merge pull request #225 from ikawaha/fix/show-version
Browse files Browse the repository at this point in the history
Fix version display
  • Loading branch information
ikawaha authored Dec 20, 2020
2 parents 35e8780 + bc1669e commit 3bf895b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@ func Usage() {
// ShowVersion prints the version about the tool.
func ShowVersion() {
info, ok := debug.ReadBuildInfo()
if version != "" {
fmt.Fprintln(errorWriter, version)
} else {
fmt.Fprintln(errorWriter, info.Main.Version)
if ok && version == "" {
version = info.Main.Version
}
if version == "" {
version = "(devel)"
}
fmt.Fprintln(errorWriter, version)
if !ok {
return
}
Expand Down

0 comments on commit 3bf895b

Please sign in to comment.