MCPcopy
hub / github.com/spf13/cobra / FlagErrorFunc

Method FlagErrorFunc

command.go:547–558  ·  view source on GitHub ↗

FlagErrorFunc returns either the function set by SetFlagErrorFunc for this command or a parent, or it returns a function which returns the original error.

()

Source from the content-addressed store, hash-verified

545// command or a parent, or it returns a function which returns the original
546// error.
547func (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
560const minUsagePadding = 25
561

Callers 1

executeMethod · 0.95

Calls 1

HasParentMethod · 0.95

Tested by

no test coverage detected