Merge pull request #46696 from xiangpengzhao/mark-deprecated-command

Automatic merge from submit-queue (batch tested with PRs 47227, 47119, 46280, 47414, 46696)

Mark deprecated info in short description of deprecated commands.

**What this PR does / why we need it**:
Mark deprecated commands in 'kubectl help'. See https://github.com/kubernetes/kubectl/issues/20

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes https://github.com/kubernetes/kubectl/issues/20

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2017-06-22 23:59:28 -07:00 committed by GitHub
commit 625a980941

View File

@ -402,6 +402,7 @@ func deprecatedAlias(deprecatedVersion string, cmd *cobra.Command) *cobra.Comman
cmd.Use = deprecatedVersion cmd.Use = deprecatedVersion
cmd.Deprecated = fmt.Sprintf("use %q instead", originalName) 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 cmd.Hidden = true
return cmd return cmd
} }