If the Subcommand is instantiated, via the Before method and has no subcommands, display the CommandHelp instead of the SubcommandHelp

This commit is contained in:
Summer Mousa
2014-04-17 11:48:00 -05:00
parent faf2a3d4a3
commit 2535376782
2 changed files with 28 additions and 11 deletions

View File

@@ -31,7 +31,8 @@ type Command struct {
// Invokes the command given the context, parses ctx.Args() to generate command-specific flags
func (c Command) Run(ctx *Context) error {
if (c.Subcommands != nil && len(c.Subcommands) > 0) || c.Before != nil {
if len(c.Subcommands) > 0 || c.Before != nil {
return c.startApp(ctx)
}