From 485ca5900486b7fc3ea71cbcbb39b87272ae09fd Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Wed, 22 May 2019 20:53:53 +0200 Subject: vendor: update dependencies --- vendor/github.com/spf13/cobra/args.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'vendor/github.com/spf13/cobra/args.go') diff --git a/vendor/github.com/spf13/cobra/args.go b/vendor/github.com/spf13/cobra/args.go index a5d8a927..c4d820b8 100644 --- a/vendor/github.com/spf13/cobra/args.go +++ b/vendor/github.com/spf13/cobra/args.go @@ -78,6 +78,18 @@ func ExactArgs(n int) PositionalArgs { } } +// ExactValidArgs returns an error if +// there are not exactly N positional args OR +// there are any positional args that are not in the `ValidArgs` field of `Command` +func ExactValidArgs(n int) PositionalArgs { + return func(cmd *Command, args []string) error { + if err := ExactArgs(n)(cmd, args); err != nil { + return err + } + return OnlyValidArgs(cmd, args) + } +} + // RangeArgs returns an error if the number of args is not within the expected range. func RangeArgs(min int, max int) PositionalArgs { return func(cmd *Command, args []string) error { -- cgit