Merge pull request #626 from urfave/do-not-double-print-before-errors

Do not double print errors from Before()
This commit is contained in:
Jesse Szwedko 2017-06-24 20:12:38 -07:00 committed by GitHub
commit 3ddfc81916
2 changed files with 0 additions and 3 deletions

1
app.go
View File

@ -240,7 +240,6 @@ func (a *App) Run(arguments []string) (err error) {
if a.Before != nil {
beforeErr := a.Before(context)
if beforeErr != nil {
fmt.Fprintf(a.Writer, "%v\n\n", beforeErr)
ShowAppHelp(context)
HandleExitCoder(beforeErr)
err = beforeErr

View File

@ -197,8 +197,6 @@ func (c Command) Run(ctx *Context) (err error) {
if c.Before != nil {
err = c.Before(context)
if err != nil {
fmt.Fprintln(context.App.Writer, err)
fmt.Fprintln(context.App.Writer)
ShowCommandHelp(context, c.Name)
HandleExitCoder(err)
return err