Documentation
¶
Overview ¶
Package flags provides custom pflag.Value implementations for common use cases.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Semver ¶
func Semver(defaultValue string, validators ...SemverValidateFunc) pflag.Value
Semver returns a pflag.Value that parses and stores a semantic version.
Parsing is performed using semver.ParseTolerant. After parsing, any provided SemverValidateFunc validators are applied in order and may reject the version.
The returned value is initialized with defaultValue, which is used until Set is called successfully.
Types ¶
type PflagExtended ¶
PflagExtended extends pflag.Value with additional methods for retrieving the value as type T and getting valid string values.
type SemverValidateFunc ¶
SemverValidateFunc allows setting restrictions on the version.
Click to show internal directories.
Click to hide internal directories.