diff --git a/args.go b/args.go index 89155b3ad..20a022b30 100644 --- a/args.go +++ b/args.go @@ -108,8 +108,8 @@ func RangeArgs(min int, max int) PositionalArgs { } } -// ComposedArgs allows combining several PositionalArgs to work in concert. -func ComposedArgs(pargs ...PositionalArgs) PositionalArgs { +// MatchAll allows combining several PositionalArgs to work in concert. +func MatchAll(pargs ...PositionalArgs) PositionalArgs { return func(cmd *Command, args []string) error { for _, parg := range pargs { if err := parg(cmd, args); err != nil { diff --git a/args_test.go b/args_test.go index 4956a2349..5983de0d3 100644 --- a/args_test.go +++ b/args_test.go @@ -287,10 +287,10 @@ func TestChildTakesArgs(t *testing.T) { } } -func TestComposedArgs(t *testing.T) { +func TestMatchAll(t *testing.T) { // Somewhat contrived example check that ensures there are exactly 3 // arguments, and each argument is exactly 2 bytes long. - pargs := ComposedArgs( + pargs := MatchAll( ExactArgs(3), func(cmd *Command, args []string) error { for _, arg := range args {