Use []*Command instead of []Command in CommandsByName

main
Dan Buch 7 years ago
parent df5c6caa96
commit a372849da6
Signed by: meatballhat
GPG Key ID: 9685130D8B763EA7

@ -492,9 +492,7 @@ func main() {
Usage: "Load configuration from `FILE`", Usage: "Load configuration from `FILE`",
}, },
}, },
} Commands: []*cli.Command{
app.Commands = []cli.Command{
{ {
Name: "complete", Name: "complete",
Aliases: []string{"c"}, Aliases: []string{"c"},
@ -511,6 +509,7 @@ func main() {
return nil return nil
}, },
}, },
},
} }
sort.Sort(cli.FlagsByName(app.Flags)) sort.Sort(cli.FlagsByName(app.Flags))

@ -56,7 +56,7 @@ type Command struct {
CustomHelpTemplate string CustomHelpTemplate string
} }
type CommandsByName []Command type CommandsByName []*Command
func (c CommandsByName) Len() int { func (c CommandsByName) Len() int {
return len(c) return len(c)

Loading…
Cancel
Save