mirror of
https://github.com/spf13/cobra
synced 2025-05-05 12:57:22 +00:00
args: inverse the methods in ExactValidArgs
This commit is contained in:
parent
ec474022ff
commit
b3982ec9bc
2 changed files with 2 additions and 2 deletions
2
args.go
2
args.go
|
@ -113,5 +113,5 @@ func MatchAll(pargs ...PositionalArgs) PositionalArgs {
|
||||||
//
|
//
|
||||||
// Deprecated: use MatchAll(OnlyValidArgs, ExactArgs(n)) instead
|
// Deprecated: use MatchAll(OnlyValidArgs, ExactArgs(n)) instead
|
||||||
func ExactValidArgs(n int) PositionalArgs {
|
func ExactValidArgs(n int) PositionalArgs {
|
||||||
return MatchAll(OnlyValidArgs, ExactArgs(n))
|
return MatchAll(ExactArgs(n), OnlyValidArgs)
|
||||||
}
|
}
|
||||||
|
|
|
@ -488,7 +488,7 @@ func TestExactValidArgs_WithInvalidCount(t *testing.T) {
|
||||||
func TestExactValidArgs_WithInvalidCount_WithInvalidArgs(t *testing.T) {
|
func TestExactValidArgs_WithInvalidCount_WithInvalidArgs(t *testing.T) {
|
||||||
c := getCommand(ExactValidArgs(3), true)
|
c := getCommand(ExactValidArgs(3), true)
|
||||||
_, err := executeCommand(c, "three", "a", "two")
|
_, err := executeCommand(c, "three", "a", "two")
|
||||||
validOnlyWithInvalidArgs(err, t)
|
exactArgsWithInvalidCount(err, t)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestExactValidArgs_WithInvalidArgs(t *testing.T) {
|
func TestExactValidArgs_WithInvalidArgs(t *testing.T) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue