diff --git a/README.md b/README.md index 583a776..dbe1bf3 100644 --- a/README.md +++ b/README.md @@ -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 + }, }, }, } diff --git a/command.go b/command.go index 31560c3..bf0acb2 100644 --- a/command.go +++ b/command.go @@ -56,7 +56,7 @@ type Command struct { CustomHelpTemplate string } -type CommandsByName []Command +type CommandsByName []*Command func (c CommandsByName) Len() int { return len(c)