cleanup tests, check required flags in more places

This commit is contained in:
Lynn Cyrin
2019-07-28 22:19:35 -07:00
parent 7ce0af189e
commit 23f09ac1e8
3 changed files with 38 additions and 53 deletions

14
app.go
View File

@@ -339,13 +339,6 @@ func (a *App) RunAsSubcommand(ctx *Context) (err error) {
return nerr
}
cerr := checkRequiredFlags(a.Flags, set)
if cerr != nil {
showFlagError(a.Writer, cerr)
ShowSubcommandHelp(context)
return cerr
}
if checkCompletions(context) {
return nil
}
@@ -371,6 +364,13 @@ func (a *App) RunAsSubcommand(ctx *Context) (err error) {
}
}
cerr := checkRequiredFlags(a.Flags, set)
if cerr != nil {
showFlagError(a.Writer, cerr)
ShowSubcommandHelp(context)
return cerr
}
if a.After != nil {
defer func() {
afterErr := a.After(context)