run either preRun or preRunE

This commit is contained in:
Filipe Menezes 2022-05-12 17:34:07 +01:00
parent ad45c7fb08
commit 101498514a

View file

@ -830,11 +830,13 @@ func (c *Command) execute(a []string) (err error) {
return flag.ErrHelp
}
if len(initializersE) > 0 {
if err := c.preRunE(); err != nil {
return err
}
} else {
c.preRun()
}
argWoFlags := c.Flags().Args()
if c.DisableFlagParsing {