|
|
|
@ -304,6 +304,18 @@ func (a *App) RunContext(ctx context.Context, arguments []string) (err error) {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if a.After != nil {
|
|
|
|
|
defer func() {
|
|
|
|
|
if afterErr := a.After(cCtx); afterErr != nil {
|
|
|
|
|
if err != nil {
|
|
|
|
|
err = newMultiError(err, afterErr)
|
|
|
|
|
} else {
|
|
|
|
|
err = afterErr
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if !a.HideHelp && checkHelp(cCtx) {
|
|
|
|
|
_ = ShowAppHelp(cCtx)
|
|
|
|
|
return nil
|
|
|
|
@ -320,18 +332,6 @@ func (a *App) RunContext(ctx context.Context, arguments []string) (err error) {
|
|
|
|
|
return cerr
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if a.After != nil {
|
|
|
|
|
defer func() {
|
|
|
|
|
if afterErr := a.After(cCtx); afterErr != nil {
|
|
|
|
|
if err != nil {
|
|
|
|
|
err = newMultiError(err, afterErr)
|
|
|
|
|
} else {
|
|
|
|
|
err = afterErr
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if a.Before != nil {
|
|
|
|
|
beforeErr := a.Before(cCtx)
|
|
|
|
|
if beforeErr != nil {
|
|
|
|
|