chore(cli): rename Cmd to Command (#12616)

I think Command is cleaner and my original decision to use "Cmd"
a mistake.

Plus this creates better parity with cobra.
This commit is contained in:
Ammar Bandukwala
2024-03-17 09:45:26 -05:00
committed by GitHub
parent 2a77580ba6
commit b4c0fa80d8
95 changed files with 313 additions and 311 deletions

View File

@ -107,7 +107,7 @@ var usageTemplate = func() *template.Template {
}
return sb.String()
},
"formatSubcommand": func(cmd *serpent.Cmd) string {
"formatSubcommand": func(cmd *serpent.Command) string {
// Minimize padding by finding the longest neighboring name.
maxNameLength := len(cmd.Name())
if parent := cmd.Parent; parent != nil {
@ -189,12 +189,12 @@ var usageTemplate = func() *template.Template {
s = wrapTTY(s)
return s
},
"visibleChildren": func(cmd *serpent.Cmd) []*serpent.Cmd {
return filterSlice(cmd.Children, func(c *serpent.Cmd) bool {
"visibleChildren": func(cmd *serpent.Command) []*serpent.Command {
return filterSlice(cmd.Children, func(c *serpent.Command) bool {
return !c.Hidden
})
},
"optionGroups": func(cmd *serpent.Cmd) []optionGroup {
"optionGroups": func(cmd *serpent.Command) []optionGroup {
groups := []optionGroup{{
// Default group.
Name: "",