From 13b960efb42775dd51c99f0f5971b66fadf1362b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Nov 2023 03:29:03 +0000 Subject: [PATCH] Bump github.com/alecthomas/kingpin/v2 from 2.3.2 to 2.4.0 Bumps [github.com/alecthomas/kingpin/v2](https://github.com/alecthomas/kingpin) from 2.3.2 to 2.4.0. - [Release notes](https://github.com/alecthomas/kingpin/releases) - [Commits](https://github.com/alecthomas/kingpin/compare/v2.3.2...v2.4.0) --- updated-dependencies: - dependency-name: github.com/alecthomas/kingpin/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- vendor/github.com/alecthomas/kingpin/v2/app.go | 10 +++++++++- vendor/github.com/alecthomas/kingpin/v2/templates.go | 2 +- vendor/modules.txt | 2 +- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 7c3eccb..1a92b95 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/sirupsen/logrus v1.9.3 ) -require github.com/alecthomas/kingpin/v2 v2.3.2 +require github.com/alecthomas/kingpin/v2 v2.4.0 require ( github.com/beorn7/perks v1.0.1 // indirect diff --git a/go.sum b/go.sum index 00af9ff..da7c97e 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ code.cloudfoundry.org/credhub-cli v0.0.0-20230912005203-ed177c58e40c h1:jFBCo2KEgFOS6hvz6dca0C8r74eLsRpddd73y1hkDzw= code.cloudfoundry.org/credhub-cli v0.0.0-20230912005203-ed177c58e40c/go.mod h1:633M1ipkGr9Ee1EkvPBycAwzHKgxAbdRs8KRpVm8V0U= -github.com/alecthomas/kingpin/v2 v2.3.2 h1:H0aULhgmSzN8xQ3nX1uxtdlTHYoPLu5AhHxWrKI6ocU= -github.com/alecthomas/kingpin/v2 v2.3.2/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE= +github.com/alecthomas/kingpin/v2 v2.4.0 h1:f48lwail6p8zpO1bC4TxtqACaGqHYA22qkHjHpqDjYY= +github.com/alecthomas/kingpin/v2 v2.4.0/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= diff --git a/vendor/github.com/alecthomas/kingpin/v2/app.go b/vendor/github.com/alecthomas/kingpin/v2/app.go index 3818010..4f1f31b 100644 --- a/vendor/github.com/alecthomas/kingpin/v2/app.go +++ b/vendor/github.com/alecthomas/kingpin/v2/app.go @@ -413,6 +413,10 @@ func (a *Application) setDefaults(context *ParseContext) error { if flag.name == "help" { return nil } + + if flag.name == "version" { + return nil + } flagElements[flag.name] = element } } @@ -460,14 +464,18 @@ func (a *Application) validateRequired(context *ParseContext) error { } // Check required flags and set defaults. + var missingFlags []string for _, flag := range context.flags.long { if flagElements[flag.name] == nil { // Check required flags were provided. if flag.needsValue() { - return fmt.Errorf("required flag --%s not provided", flag.name) + missingFlags = append(missingFlags, fmt.Sprintf("'--%s'", flag.name)) } } } + if len(missingFlags) != 0 { + return fmt.Errorf("required flag(s) %s not provided", strings.Join(missingFlags, ", ")) + } for _, arg := range context.arguments.args { if argElements[arg.name] == nil { diff --git a/vendor/github.com/alecthomas/kingpin/v2/templates.go b/vendor/github.com/alecthomas/kingpin/v2/templates.go index 9694046..703c2cd 100644 --- a/vendor/github.com/alecthomas/kingpin/v2/templates.go +++ b/vendor/github.com/alecthomas/kingpin/v2/templates.go @@ -248,7 +248,7 @@ complete -F _{{.App.Name}}_bash_autocomplete -o default {{.App.Name}} var ZshCompletionTemplate = `#compdef {{.App.Name}} _{{.App.Name}}() { - local matches=($(${words[1]} --completion-bash "${(@)words[1,$CURRENT]}")) + local matches=($(${words[1]} --completion-bash "${(@)words[2,$CURRENT]}")) compadd -a matches if [[ $compstate[nmatches] -eq 0 && $words[$CURRENT] != -* ]]; then diff --git a/vendor/modules.txt b/vendor/modules.txt index f33aee1..8fad248 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -9,7 +9,7 @@ code.cloudfoundry.org/credhub-cli/credhub/credentials/values code.cloudfoundry.org/credhub-cli/credhub/permissions code.cloudfoundry.org/credhub-cli/credhub/server code.cloudfoundry.org/credhub-cli/errors -# github.com/alecthomas/kingpin/v2 v2.3.2 +# github.com/alecthomas/kingpin/v2 v2.4.0 ## explicit; go 1.17 github.com/alecthomas/kingpin/v2 # github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137