Skip to content

Commit

Permalink
build(deps): bump kong to 0.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
zbindenren committed Jun 22, 2023
1 parent cc83a80 commit f3204c6
Show file tree
Hide file tree
Showing 5 changed files with 428 additions and 46 deletions.
20 changes: 9 additions & 11 deletions env.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,21 @@ import (
"github.com/alecthomas/kong"
)

var (
ignoredFlagsNames = map[string]bool{
"help": true,
"env-help": true,
}
)
var ignoredFlagsNames = map[string]bool{
"help": true,
"env-help": true,
}

// EnvResolver returns a Resolver that retrieves values from environment variables.
//
// Hyphens in flag names are replaced with underscores.
// Flag names are prefixed with app name and converted to uppercase.
//
// Usage:
// ctx := kong.Parse(&cli,
// kong.Resolvers(pfkong.EnvResolver()),
// )
// }
// Usage:
// ctx := kong.Parse(&cli,
// kong.Resolvers(pfkong.EnvResolver()),
// )
// }
func EnvResolver() kong.Resolver {
var f kong.ResolverFunc = func(context *kong.Context, parent *kong.Path, flag *kong.Flag) (interface{}, error) {
if ok := ignoredFlagsNames[flag.Name]; ok {
Expand Down
13 changes: 5 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@ module github.com/zbindenren/king
go 1.15

require (
github.com/BurntSushi/toml v0.3.1
github.com/alecthomas/kong v0.2.17
github.com/kr/text v0.2.0 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/prometheus/client_golang v1.11.0
github.com/stretchr/testify v1.7.0
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
github.com/BurntSushi/toml v1.3.2
github.com/alecthomas/kong v0.8.0
github.com/prometheus/client_golang v1.16.0
github.com/stretchr/testify v1.8.4
gopkg.in/yaml.v3 v3.0.1
)
Loading

0 comments on commit f3204c6

Please sign in to comment.