Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidRegexp = errors.New("invalid regular expression")
ErrInvalidRegexp the regular expression doesn't compile.
Functions ¶
This section is empty.
Types ¶
type RegexpValue ¶
type RegexpValue struct {
// contains filtered or unexported fields
}
RegexpValue implements pflag.Value interface to manage an array of regular expressions, thus each command-line flag represents one entry on the array.
func NewRegexpValue ¶
func NewRegexpValue(values *[]regexp.Regexp) *RegexpValue
NewRegexpValue instantiates the RegexpValue with a pointer to the slice, the pointer receives the slice (array) entries.
func (*RegexpValue) Set ¶
func (r *RegexpValue) Set(raw string) error
Set adds a regexp array entry, the raw expression must be compiled successfully.
func (*RegexpValue) String ¶
func (r *RegexpValue) String() string
String shows the current array entries as string.
func (*RegexpValue) Type ¶
func (*RegexpValue) Type() string
Type exposes the "type" to cobra's pflag.Value, a "stringArray" means each command-line flag becomes a single slice entry.
Click to show internal directories.
Click to hide internal directories.