-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Implement custom help command for kubectl #27049
Implement custom help command for kubectl #27049
Conversation
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. Otherwise, if this message is too spammy, please complain to ixdy. |
2 similar comments
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. Otherwise, if this message is too spammy, please complain to ixdy. |
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. Otherwise, if this message is too spammy, please complain to ixdy. |
help message for typo:
help message for search query:
Before this patch, help command had two options: display usage message with all commands or display help message for particular command. |
@k8s-bot ok to test |
Thanks for the pr. We're currently in code slush pending 1.3 release cut this Friday. Will take a look afterwards. |
GCE e2e build/test passed for commit ac90ddb01ac7739008e995ba8c355cdb53d7dfb3. |
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. Otherwise, if this message is too spammy, please complain to ixdy. |
2 similar comments
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. Otherwise, if this message is too spammy, please complain to ixdy. |
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. Otherwise, if this message is too spammy, please complain to ixdy. |
ok to test |
GCE e2e build/test passed for commit ac90ddb01ac7739008e995ba8c355cdb53d7dfb3. |
foundCmd, a, e := cmd.Root().Find(args) | ||
|
||
// NOTE(andreykurilin): actually, I did not find any cases when foundCmd can be nill, | ||
// but let's make this checks since it is included in original code of initHelpCmd from |
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.
s/nill/nil, s/checks/check
Nice improvement. This deserves a brief release-note mention. Add a line like
in top level comment. |
ac90ddb
to
b6b3626
Compare
@jlowdermilk done |
GCE e2e build/test passed for commit b6b36264e898a318de99caec4b50df87c4e65179. |
lgtm. Verify script is complaining that you need to run go fmt on help.go. |
b6b3626
to
296cfee
Compare
@jlowdermilk fixed |
GCE e2e build/test passed for commit 296cfeee6f7dfb84741331b85a5a219806459345. |
@@ -0,0 +1,79 @@ | |||
/* | |||
Copyright 2014 The Kubernetes Authors All rights reserved. |
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.
2016
296cfee
to
669a466
Compare
@jlowdermilk the year is uptodate now. please put LGTM again:) |
GCE e2e build/test passed for commit 669a466efcb19fdc567028e6a5eb92ed96e037e0. |
Ah, there was a recent change to the header wording across all files. You'll need to update boilerplate in help.go to match hack/boilerplate/boilerplate.go.txt. For future reference, you can run the verification check locally using |
Own implemenation of help command allows to print `Did you mean this?` with suggestions, which is missed in embed help command from github.com/spf13/cobra Also, it can be extended with different search features. At this patch, help command search query in short descriptions of commands in case of mismatch with commands names. fixes #25234
669a466
to
48d47b1
Compare
GCE e2e build/test passed for commit 48d47b1. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit 48d47b1. |
Automatic merge from submit-queue |
Custom implementation of help command allows to print
Did you mean this?
withsuggestions, which is missed in embed help command from github.com/spf13/cobra
Also, it can be extended with different search features. At this patch, help
command searches query in short descriptions of commands in case of mismatch
with commands names.
fixes #25234