Merge remote-tracking branch 'origin/v1' into merging-from-v1

This commit is contained in:
Dan Buch
2016-06-22 12:03:21 -04:00
3 changed files with 27 additions and 8 deletions

14
app.go
View File

@@ -113,13 +113,6 @@ func (a *App) Setup() {
}
a.Commands = newCmds
a.Categories = newCommandCategories()
for _, command := range a.Commands {
a.Categories.AddCommand(command.Category, command)
}
sort.Sort(a.Categories.(*commandCategories))
// append help to commands
if a.Command(helpCommand.Name) == nil && !a.HideHelp {
a.appendCommand(helpCommand)
@@ -128,7 +121,6 @@ func (a *App) Setup() {
}
}
//append version/help flags
if a.EnableBashCompletion {
a.appendFlag(BashCompletionFlag)
}
@@ -136,6 +128,12 @@ func (a *App) Setup() {
if !a.HideVersion {
a.appendFlag(VersionFlag)
}
a.Categories = newCommandCategories()
for _, command := range a.Commands {
a.Categories.AddCommand(command.Category, command)
}
sort.Sort(a.Categories.(*commandCategories))
}
// Run is the entry point to the cli app. Parses the arguments slice and routes