mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 07:57:35 +00:00
Implement custom help command for kubectl
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
This commit is contained in:
committed by
Andrey Kurilin
parent
6159126740
commit
48d47b1027
@@ -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