Skip to content

Commit

Permalink
rename to MatchAll
Browse files Browse the repository at this point in the history
  • Loading branch information
nelz9999 committed Nov 16, 2021
1 parent c02fa6c commit 1dabb28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions args.go
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions args_test.go
Expand Up @@ -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 {
Expand Down

0 comments on commit 1dabb28

Please sign in to comment.