Documentation
¶
Overview ¶
Package enumflag provides a pflag.Value implementation that restricts a string flag to a fixed set of allowed values, rejecting off-enum input (including the empty string) at flag-parse time rather than silently accepting it downstream.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New returns a pflag.Value that writes through to target and rejects any value not in allowed. When caseInsensitive is true, comparison is case-folded but the original (caller-typed) value is stored in target so downstream normalisation (e.g. mapPRState) sees exactly what the user passed. The empty string is never a member of allowed unless explicitly listed, so "" is rejected like any other off-enum value.
Types ¶
This section is empty.