args: inverse the methods in ExactValidArgs

This commit is contained in:
umarcor 2022-08-30 19:29:43 +02:00
parent ec474022ff
commit b3982ec9bc
2 changed files with 2 additions and 2 deletions

View file

@ -113,5 +113,5 @@ func MatchAll(pargs ...PositionalArgs) PositionalArgs {
//
// Deprecated: use MatchAll(OnlyValidArgs, ExactArgs(n)) instead
func ExactValidArgs(n int) PositionalArgs {
return MatchAll(OnlyValidArgs, ExactArgs(n))
return MatchAll(ExactArgs(n), OnlyValidArgs)
}

View file

@ -488,7 +488,7 @@ func TestExactValidArgs_WithInvalidCount(t *testing.T) {
func TestExactValidArgs_WithInvalidCount_WithInvalidArgs(t *testing.T) {
c := getCommand(ExactValidArgs(3), true)
_, err := executeCommand(c, "three", "a", "two")
validOnlyWithInvalidArgs(err, t)
exactArgsWithInvalidCount(err, t)
}
func TestExactValidArgs_WithInvalidArgs(t *testing.T) {