Use FlagErrorFunc for validateRequiredFlags and validateFlagGroups

This let's handle all flag errors and decide how to print them on the fly
This commit is contained in:
Sergey Vilgelm 2022-06-09 10:03:21 -07:00
parent ca8e3c2779
commit 5c62c6a057
No known key found for this signature in database
GPG key ID: 08D0E2FF778887E6

View file

@ -861,10 +861,10 @@ func (c *Command) execute(a []string) (err error) {
}
if err := c.validateRequiredFlags(); err != nil {
return err
return c.FlagErrorFunc()(c, err)
}
if err := c.validateFlagGroups(); err != nil {
return err
return c.FlagErrorFunc()(c, err)
}
if c.RunE != nil {