Skip to content

Commit

Permalink
args: inverse the methods in ExactValidArgs
Browse files Browse the repository at this point in the history
  • Loading branch information
umarcor committed Aug 30, 2022
1 parent ec47402 commit b3982ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion args.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
2 changes: 1 addition & 1 deletion args_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b3982ec

Please sign in to comment.