Skip to content

Commit

Permalink
Merge pull request #60 from WillAbides/versionfix
Browse files Browse the repository at this point in the history
fix `bindown version`
  • Loading branch information
WillAbides authored Apr 11, 2020
2 parents f58527f + 62c7890 commit 29fe824
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions cmd/bindown/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ import (
"github.com/willabides/bindown/v2/internal/cli"
)

var version string

func main() {
if version != "" {
cli.Version = version
}
cli.Run(os.Args[1:])
}
5 changes: 3 additions & 2 deletions internal/cli/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import (
"github.com/alecthomas/kong"
)

var version = "unknown"
//Version version to display for `bindown version`
var Version = "unknown"

type versionCmd struct{}

func (*versionCmd) Run(k *kong.Context) error {
k.Printf("version %s", version)
k.Printf("version %s", Version)
return nil
}

0 comments on commit 29fe824

Please sign in to comment.