Skip to content

Commit

Permalink
add: --version support
Browse files Browse the repository at this point in the history
  • Loading branch information
LeKovr committed Jan 4, 2025
1 parent f031079 commit abf8ae0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions cmd/showonce/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import (

// Config holds all config vars.
type Config struct {
config.Config
Listen string `default:":8080" description:"Addr and port which server listens at" long:"listen"`
ListenGRPC string `default:":8081" description:"Addr and port which GRPC pub server listens at" long:"listen_grpc"`
Root string `default:"" description:"Static files root directory" env:"ROOT" long:"root"`
Expand Down Expand Up @@ -76,6 +77,9 @@ func Run(ctx context.Context, exitFunc func(code int)) {
if err != nil {
return
}
if err = cfg.VersionRequested(application, version); err != nil {
return
}
err = slogger.Setup(cfg.Logger, nil)
if err != nil {
return
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.22.7
toolchain go1.23.2

require (
github.com/LeKovr/go-kit/config v0.2.2
github.com/LeKovr/go-kit/config v0.3.0
github.com/LeKovr/go-kit/server v0.14.0
github.com/LeKovr/go-kit/slogger v0.14.0
github.com/LeKovr/go-kit/ver v0.10.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/LeKovr/go-kit/config v0.2.2 h1:qKd3eYjzvGVhp1G7BmnrEVLD8WRlPwamkkZFk9Hnwbs=
github.com/LeKovr/go-kit/config v0.2.2/go.mod h1:/pwowGPoobH1dIf1j42II1DsVPaYWBBfLR2UZ4NnFDM=
github.com/LeKovr/go-kit/config v0.3.0 h1:EXkmWHTpb3C21Jy7w+ojVbF27bBcQqAvKCqBTZ7kdRg=
github.com/LeKovr/go-kit/config v0.3.0/go.mod h1:/pwowGPoobH1dIf1j42II1DsVPaYWBBfLR2UZ4NnFDM=
github.com/LeKovr/go-kit/server v0.14.0 h1:9RYLLPOKFeLFwcPL8GfGdefWn0W2NUhqr6UV2FwpX7Y=
github.com/LeKovr/go-kit/server v0.14.0/go.mod h1:QWCjQKcMrOhkhF2Zlna5/J7185hlYHr+R7sqsTlfLzg=
github.com/LeKovr/go-kit/slogger v0.14.0 h1:M5Xc5Twd5Am2maA3P9wO3ay2hfLxToTjPQ0QxMBMzec=
Expand Down

0 comments on commit abf8ae0

Please sign in to comment.