Display error instead of just say command is incorrect

This commit is contained in:
Richard Kovacs
2016-10-07 16:38:36 +02:00
committed by mhmxs
parent 55f715e28c
commit 4cc2bad36e
3 changed files with 20 additions and 3 deletions

4
app.go
View File

@@ -194,7 +194,7 @@ func (a *App) Run(arguments []string) (err error) {
HandleExitCoder(err)
return err
}
fmt.Fprintf(a.Writer, "%s\n\n", "Incorrect Usage.")
fmt.Fprintf(a.Writer, "%s %s\n\n", "Incorrect Usage.", err.Error())
ShowAppHelp(context)
return err
}
@@ -315,7 +315,7 @@ func (a *App) RunAsSubcommand(ctx *Context) (err error) {
HandleExitCoder(err)
return err
}
fmt.Fprintf(a.Writer, "%s\n\n", "Incorrect Usage.")
fmt.Fprintf(a.Writer, "%s %s\n\n", "Incorrect Usage.", err.Error())
ShowSubcommandHelp(context)
return err
}