1
0
Fork 0
mirror of https://github.com/spf13/cobra synced 2025-08-13 05:07:50 +00:00

rename to MatchAll

This commit is contained in:
Nelz 2019-07-03 10:15:25 -07:00
commit 1dabb28da3
2 changed files with 4 additions and 4 deletions

View file

@ -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 {

View file

@ -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 {