Documentation
¶
Overview ¶
Package mflag provides utility functions for pairing matcher.Matcher functions with a pflag.FlagSet. The provided functions exist only to have a uniform and unified call-site for declaring a flag with an associated matcher.Matcher.
Index ¶
- type FlagSet
- func (m *FlagSet) BoolMatcher(callback func() matcher.Matcher, name string, usage string)
- func (m *FlagSet) Matcher() (matcher.Matcher, error)
- func (m *FlagSet) StringMatcher(callback func(string) (matcher.Matcher, error), name string, usage string)
- func (m *FlagSet) StringSliceMatcher(callback func(string) (matcher.Matcher, error), name string, usage string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FlagSet ¶
type FlagSet struct {
// contains filtered or unexported fields
}
FlagSet pairs a pflag.FlagSet with a number of matcher.Matcher instances (including negative matcher.Matcher instances). A series of individual flags can be defined, and then an aggregate matcher can be composed based on their provided values at runtime.
func NewMatcherFlags ¶
NewMatcherFlags returns a new FlagSet bound to the provided pflag.FlagSet.
func (*FlagSet) BoolMatcher ¶
BoolMatcher creates a named bool flag paired with the given matcher.Matcher constructor.
func (*FlagSet) Matcher ¶
Matcher returns a composed matcher.Matcher derived from each defined flag and their runtime value(s).