adjust docs

This commit is contained in:
umarcor 2022-08-30 19:57:51 +02:00
parent 6863083cdd
commit 8095ca31dd
2 changed files with 2 additions and 2 deletions

View file

@ -111,7 +111,7 @@ func MatchAll(pargs ...PositionalArgs) PositionalArgs {
// ExactValidArgs returns an error if there are not exactly N positional args OR
// there are any positional args that are not in the `ValidArgs` field of `Command`
//
// Deprecated: use MatchAll(OnlyValidArgs, ExactArgs(n)) instead
// Deprecated: use MatchAll(ExactArgs(n), OnlyValidArgs) instead
func ExactValidArgs(n int) PositionalArgs {
return MatchAll(ExactArgs(n), OnlyValidArgs)
}

View file

@ -349,7 +349,7 @@ shown below:
```go
var cmd = &cobra.Command{
Short: "hello",
Args: MatchAll(OnlyValidArgs, ExactArgs(2)),
Args: MatchAll(ExactArgs(2), OnlyValidArgs),
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("Hello, World!")
},