From dd3dd59ea2d2ec03b837222b0564cd552c60b6e4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Nov 2023 03:52:17 +0000 Subject: [PATCH] Bump github.com/alecthomas/kingpin/v2 from 2.3.2 to 2.4.0 (#242) --- 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 c58d2124..549437af 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( google.golang.org/protobuf v1.31.0 // indirect ) -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 1b2f5f0f..62bc8ef2 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -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/apache/cloudstack-go/v2 v2.15.0 h1:oojn1qx0+wBwrFSSmA2rL8XjWd4BXqwYo0RVCrAXoHk= diff --git a/vendor/github.com/alecthomas/kingpin/v2/app.go b/vendor/github.com/alecthomas/kingpin/v2/app.go index 38180108..4f1f31be 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 96940465..703c2cda 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 677bd6d0..5d51c3b9 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,4 +1,4 @@ -# 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