Skip to content

Commit

Permalink
Merge pull request #5841 from r-vasquez/deprecate-cmd-in-childs
Browse files Browse the repository at this point in the history
rpk: add a method to deprecate child commands
  • Loading branch information
twmb committed Aug 5, 2022
2 parents d3bb917 + 627e625 commit ff6bc3f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/go/rpk/pkg/cli/cmd/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ https://redpanda.com/feedback`
func Deprecated(newCmd *cobra.Command, newUse string) *cobra.Command {
newCmd.Deprecated = fmt.Sprintf("use %q instead", newUse)
newCmd.Hidden = true

if children := newCmd.Commands(); len(children) > 0 {
for _, child := range children {
Deprecated(child, newUse+" "+child.Name())
}
}
return newCmd
}

Expand Down

0 comments on commit ff6bc3f

Please sign in to comment.