Skip to content

Commit

Permalink
Include version number in build
Browse files Browse the repository at this point in the history
  • Loading branch information
colinodell committed Dec 31, 2021
1 parent b1352ed commit 67009da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ builds:
- goos: darwin
goarch: 386
binary: '{{ .ProjectName }}'
ldflags: -s -w
ldflags: -s -w -X 'main.version={{ .Version }}'
flags:
- -trimpath

Expand Down Expand Up @@ -67,6 +67,8 @@ brews:
homepage: https://github.com/colinodell/go-check-ssl
description: Simple command line utility to check the status of an SSL certificate
license: MIT
test: |
system "#{bin}/check-ssl --version"
install: |-
bin.install "{{ .ProjectName }}"
Expand Down
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ import (
var (
server = kingpin.Arg("host", "Hostname, IP, or URL of the server to check.").String()
sni = kingpin.Flag("sni", "SNI server to use for the certificate (optional).").Short('s').String()
version = "dev"
)

func main() {
log.SetLogger(new(logger))

kingpin.Version(version)
kingpin.Parse()
if server == nil || *server == "" {
kingpin.Usage()
Expand Down

0 comments on commit 67009da

Please sign in to comment.