Skip to content

Commit

Permalink
Add proper version display
Browse files Browse the repository at this point in the history
  • Loading branch information
boazy committed Feb 25, 2018
1 parent 00345fb commit 0064281
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ builds:
- amd64
- arm
- arm64
ldflags: '-s -w -X main.version={{.Version}} -X main.buildDate={{.Date}'
changelog:
sort: asc
filters:
exclude:
- Merge pull request
- Merge branch
checksum: '{{ .ProjectName }}-{{ .Version }}-checksums.txt'
archive:
name_template: '{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
replacements:
Expand Down
9 changes: 8 additions & 1 deletion jwkgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import (
)

var (
buildDate string
version string

bareOutput = false
allowUnsafe = kingpin.
Flag("allow-unsafe", "Allow unsafe parameters").Bool()
Expand All @@ -26,7 +29,11 @@ var (
)

func main() {
kingpin.Version("1.3.0")
if version == "" {
kingpin.Version("JWK Generator (jwkgen) development snapshot")
} else {
kingpin.Version(fmt.Sprintf("JWK Generator (jwkgen) version %s\nBuild date: %s", version, buildDate))
}
kingpin.CommandLine.HelpFlag.Short('h')
kingpin.Parse()

Expand Down

0 comments on commit 0064281

Please sign in to comment.