From 08304cc0387f37a3a8176d6dbb1e11597fa5abed Mon Sep 17 00:00:00 2001 From: Nelz Date: Tue, 2 Jul 2019 10:45:22 -0700 Subject: [PATCH] ExactValidArgs slated for removal --- args.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/args.go b/args.go index ead9fa5f..89155b3a 100644 --- a/args.go +++ b/args.go @@ -90,7 +90,12 @@ func ExactArgs(n int) PositionalArgs { // 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 ComposedArgs(ExactArgs(n), OnlyValidArgs) + 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.