mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 14:14:39 +00:00
kubectl: make "Deprecated" a private function
There's no reason to export this function, so I've made it private.
This commit is contained in:
@@ -357,7 +357,7 @@ func NewKubectlCommand(f cmdutil.Factory, in io.Reader, out, err io.Writer) *cob
|
|||||||
|
|
||||||
filters := []string{
|
filters := []string{
|
||||||
"options",
|
"options",
|
||||||
Deprecated("kubectl", "delete", cmds, NewCmdStop(f, out)),
|
deprecated("kubectl", "delete", cmds, NewCmdStop(f, out)),
|
||||||
}
|
}
|
||||||
templates.ActsAsRootCommand(cmds, filters, groups...)
|
templates.ActsAsRootCommand(cmds, filters, groups...)
|
||||||
|
|
||||||
@@ -405,12 +405,12 @@ func deprecatedAlias(deprecatedVersion string, cmd *cobra.Command) *cobra.Comman
|
|||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated is similar to deprecatedAlias, but it is used for deprecations
|
// deprecated is similar to deprecatedAlias, but it is used for deprecations
|
||||||
// that are not simple aliases; this command is actually a different
|
// that are not simple aliases; this command is actually a different
|
||||||
// (deprecated) codepath.
|
// (deprecated) codepath.
|
||||||
func Deprecated(baseName, to string, parent, cmd *cobra.Command) string {
|
func deprecated(baseName, to string, parent, cmd *cobra.Command) string {
|
||||||
cmd.Long = fmt.Sprintf("Deprecated: This command is deprecated, all its functionalities are covered by \"%s %s\"", baseName, to)
|
cmd.Long = fmt.Sprintf("Deprecated: all functionality can be found in \"%s %s\"", baseName, to)
|
||||||
cmd.Short = fmt.Sprintf("Deprecated: %s", to)
|
cmd.Short = fmt.Sprintf("Deprecated: use %s", to)
|
||||||
parent.AddCommand(cmd)
|
parent.AddCommand(cmd)
|
||||||
return cmd.Name()
|
return cmd.Name()
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user