remove unused func deprecatedAlias

This commit is contained in:
Pingan2017
2018-12-10 16:08:32 +08:00
parent 27fca554e1
commit c1243ddd05
3 changed files with 0 additions and 70 deletions

View File

@@ -555,18 +555,3 @@ func NewKubectlCommand(in io.Reader, out, err io.Writer) *cobra.Command {
func runHelp(cmd *cobra.Command, args []string) {
cmd.Help()
}
// deprecatedAlias is intended to be used to create a "wrapper" command around
// an existing command. The wrapper works the same but prints a deprecation
// message before running. This command is identical functionality.
func deprecatedAlias(deprecatedVersion string, cmd *cobra.Command) *cobra.Command {
// Have to be careful here because Cobra automatically extracts the name
// of the command from the .Use field.
originalName := cmd.Name()
cmd.Use = deprecatedVersion
cmd.Deprecated = fmt.Sprintf("use %q instead", originalName)
cmd.Short = fmt.Sprintf("%s. This command is deprecated, use %q instead", cmd.Short, originalName)
cmd.Hidden = true
return cmd
}