ExactValidArgs slated for removal

This commit is contained in:
Nelz 2019-07-02 10:45:22 -07:00
parent 488a4bc560
commit 08304cc038

View file

@ -90,7 +90,12 @@ func ExactArgs(n int) PositionalArgs {
// there are not exactly N positional args OR // there are not exactly N positional args OR
// there are any positional args that are not in the `ValidArgs` field of `Command` // there are any positional args that are not in the `ValidArgs` field of `Command`
func ExactValidArgs(n int) PositionalArgs { 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. // RangeArgs returns an error if the number of args is not within the expected range.