mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
Merge pull request #27049 from andreykurilin/kubectl_help
Automatic merge from submit-queue Implement custom help command for kubectl ```release-note * kubectl help now provides "Did you mean this?" suggestions for typo/invalid command names. ``` Custom implementation 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 searches query in short descriptions of commands in case of mismatch with commands names. fixes #25234
This commit is contained in:
@@ -198,6 +198,8 @@ Find more information at https://github.com/kubernetes/kubernetes.`,
|
||||
f.BindFlags(cmds.PersistentFlags())
|
||||
f.BindExternalFlags(cmds.PersistentFlags())
|
||||
|
||||
cmds.SetHelpCommand(NewCmdHelp(f, out))
|
||||
|
||||
// From this point and forward we get warnings on flags that contain "_" separators
|
||||
cmds.SetGlobalNormalizationFunc(flag.WarnWordSepNormalizeFunc)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user