Use []*Command instead of []Command in CommandsByName
This commit is contained in:
parent
df5c6caa96
commit
a372849da6
@ -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…
Reference in New Issue
Block a user