Replace deprecated ExactValidArgs with MatchAll in user_guide and shell_completions example#1836
Conversation
marckhouzam
left a comment
There was a problem hiding this comment.
Thanks for noticing @doniacld
shell_completions.md
Outdated
| DisableFlagsInUseLine: true, | ||
| ValidArgs: []string{"bash", "zsh", "fish", "powershell"}, | ||
| Args: cobra.ExactValidArgs(1), | ||
| Args: MatchAll(ExactArgs(1), OnlyValidArgs), |
There was a problem hiding this comment.
This should be cobra.MatchAll(ExactArgs(1), OnlyValidArgs),
There was a problem hiding this comment.
Thanks, I fixed it it is actually cobra.MatchAll(cobra.ExactArgs(1), cobra.OnlyValidArgs) :)
There was a problem hiding this comment.
Thanks for noticing @doniacld
I did not see any hacktoberfest labels in PRs around here but I was wondering if you would accept adding the label hacktoberfest-accepted to mine so it can count. Thanks in advance 😇
NB: Actually found the problem by solving an issue in Trivy btw 🚀
There was a problem hiding this comment.
While we're at it, would you mind also fixing the 3 missing cobra. prefixes in:
Line 352 in badcce1
There was a problem hiding this comment.
For sure, fixed and checking if there is any left.
e6b6241 to
b786670
Compare
…ll_completions example
b786670 to
17573c4
Compare
|
Thanks @doniacld ! Label added. Let me know if I have to do something else for this contribution to count for your stats. |
All good! Thanks a lot. 🙏🏽 |
Update the example from
shell_completionsby replacingExactValidArgswhich is deprecated from the documentation byMatchAll(ExactArgs(1), OnlyValidArgs).