FlagErrorFunc returns either the function set by SetFlagErrorFunc for this command or a parent, or it returns a function which returns the original error.
()
| 545 | // command or a parent, or it returns a function which returns the original |
| 546 | // error. |
| 547 | func (c *Command) FlagErrorFunc() (f func(*Command, error) error) { |
| 548 | if c.flagErrorFunc != nil { |
| 549 | return c.flagErrorFunc |
| 550 | } |
| 551 | |
| 552 | if c.HasParent() { |
| 553 | return c.parent.FlagErrorFunc() |
| 554 | } |
| 555 | return func(c *Command, err error) error { |
| 556 | return err |
| 557 | } |
| 558 | } |
| 559 | |
| 560 | const minUsagePadding = 25 |
| 561 |