Skip to content

Commit

Permalink
Use version flag
Browse files Browse the repository at this point in the history
  • Loading branch information
gzuidhof committed Apr 16, 2024
1 parent 12fcef4 commit 0bb739c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion buildinfo/buildinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func Commit() string {
}

// Target returns the target operating system that this binary was compiled for,
// or "" if it is not set. This is injected by goreleaser.
// or "" if it is not set.
func Target() string {
return runtime.GOOS
}
Expand Down
3 changes: 2 additions & 1 deletion cmd/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type Config struct {
File string `help:"Path to read response from." short:"f" default:"agentstate"`
} `cmd:"" help:"Start hareply TCP responder service."`

Version struct{} `cmd:"" help:"Show version information."`
Version kong.VersionFlag
}

// CLI runs the hareply CLI.
Expand All @@ -34,6 +34,7 @@ func CLI(ctx context.Context, w io.Writer, args []string, opts ...kong.Option) e
kong.Name("hareply"),
kong.Description("A simple TCP server that replies with a response read from a file."),
kong.DefaultEnvars("HAREPLY_"),
kong.Vars{"version": buildinfo.FullVersion()},
)

kcli, err := kong.New(&cli, opts...)
Expand Down

0 comments on commit 0bb739c

Please sign in to comment.