Use parsed context when running command as subcommnd

Rather than passing the unparsed context (parent context) in whenever
there are no subcommands.
This commit is contained in:
jszwedko
2015-01-09 14:46:29 -05:00
parent bf4a526f48
commit 5159b98cbc
2 changed files with 27 additions and 5 deletions

6
app.go
View File

@@ -242,11 +242,7 @@ func (a *App) RunAsSubcommand(ctx *Context) error {
}
// Run default Action
if len(a.Commands) > 0 {
a.Action(context)
} else {
a.Action(ctx)
}
a.Action(context)
return nil
}