Use []*Command instead of []Command in CommandsByName
This commit is contained in:
parent
df5c6caa96
commit
a372849da6
31
README.md
31
README.md
@ -492,23 +492,22 @@ func main() {
|
|||||||
Usage: "Load configuration from `FILE`",
|
Usage: "Load configuration from `FILE`",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
Commands: []*cli.Command{
|
||||||
|
{
|
||||||
app.Commands = []cli.Command{
|
Name: "complete",
|
||||||
{
|
Aliases: []string{"c"},
|
||||||
Name: "complete",
|
Usage: "complete a task on the list",
|
||||||
Aliases: []string{"c"},
|
Action: func(c *cli.Context) error {
|
||||||
Usage: "complete a task on the list",
|
return nil
|
||||||
Action: func(c *cli.Context) error {
|
},
|
||||||
return nil
|
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
{
|
Name: "add",
|
||||||
Name: "add",
|
Aliases: []string{"a"},
|
||||||
Aliases: []string{"a"},
|
Usage: "add a task to the list",
|
||||||
Usage: "add a task to the list",
|
Action: func(c *cli.Context) error {
|
||||||
Action: func(c *cli.Context) error {
|
return nil
|
||||||
return nil
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -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…
Reference in New Issue
Block a user