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,23 +492,22 @@ func main() {
Usage: "Load configuration from `FILE`",
},
},
}
app.Commands = []cli.Command{
{
Name: "complete",
Aliases: []string{"c"},
Usage: "complete a task on the list",
Action: func(c *cli.Context) error {
return nil
Commands: []*cli.Command{
{
Name: "complete",
Aliases: []string{"c"},
Usage: "complete a task on the list",
Action: func(c *cli.Context) error {
return nil
},
},
},
{
Name: "add",
Aliases: []string{"a"},
Usage: "add a task to the list",
Action: func(c *cli.Context) error {
return nil
{
Name: "add",
Aliases: []string{"a"},
Usage: "add a task to the list",
Action: func(c *cli.Context) error {
return nil
},
},
},
}

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

Loading…
Cancel
Save