If no action is specified on the command or app, print the help documentation

Rather than panic'ing or displaying an opaque error message about the
signature which is more confusing to the end user.

Fixes #562
This commit is contained in:
Jesse Szwedko
2016-11-12 13:37:07 -08:00
parent d86a009f5e
commit 0113f56d10
4 changed files with 52 additions and 1 deletions

4
app.go
View File

@@ -242,6 +242,10 @@ func (a *App) Run(arguments []string) (err error) {
}
}
if a.Action == nil {
a.Action = helpCommand.Action
}
// Run default Action
err = HandleAction(a.Action, context)