-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace deprecated ExactValidArgs with MatchAll in user_guide and shell_completions example #1836
Replace deprecated ExactValidArgs with MatchAll in user_guide and shell_completions example #1836
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for noticing @doniacld
shell_completions.md
Outdated
@@ -71,7 +71,7 @@ PowerShell: | |||
`,cmd.Root().Name()), | |||
DisableFlagsInUseLine: true, | |||
ValidArgs: []string{"bash", "zsh", "fish", "powershell"}, | |||
Args: cobra.ExactValidArgs(1), | |||
Args: MatchAll(ExactArgs(1), OnlyValidArgs), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be cobra.MatchAll(ExactArgs(1), OnlyValidArgs),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I fixed it it is actually cobra.MatchAll(cobra.ExactArgs(1), cobra.OnlyValidArgs)
:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ha! Good point!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we're at it, would you mind also fixing the 3 missing cobra.
prefixes in:
Line 352 in badcce1
Args: MatchAll(ExactArgs(2), OnlyValidArgs), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For sure, fixed and checking if there is any left.
e6b6241
to
b786670
Compare
…ll_completions example
b786670
to
17573c4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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_completions
by replacingExactValidArgs
which is deprecated from the documentation byMatchAll(ExactArgs(1), OnlyValidArgs)
.