diff --git a/args.go b/args.go index 3f77ff10..e2f40d51 100644 --- a/args.go +++ b/args.go @@ -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) } diff --git a/user_guide.md b/user_guide.md index 8d81162a..6128ae46 100644 --- a/user_guide.md +++ b/user_guide.md @@ -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!") },