Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrUnsupportedTypeConversion = errors.New("unsupported type conversion") ErrCommandNotFound = errors.New("command not found") ErrFlagNotFound = errors.New("flag not found") ErrPosixIncompatible = errors.New("posix incompatible") ErrValidationFailed = errors.New("validation failed") ErrBindNilPointer = errors.New("can't bind flag to nil") ErrVariableNotAPointer = errors.New("variable is not a pointer") )
Functions ¶
This section is empty.
Types ¶
type ListDelimiterFunc ¶
ListDelimiterFunc signature to match when supplying a user-defined function to check for the runes which form list delimiters. Defaults to ',' || r == '|' || r == ' '.
type OptionType ¶
type OptionType int
OptionType used to define Flag types (such as Standalone, Single, Chained)
const ( Empty OptionType = iota // Empty denotes a Flag which is not set Single OptionType = 1 // Single denotes a Flag accepting a string value Chained OptionType = 2 // Chained denotes a Flag accepting a string value which should be evaluated as a list (split on ' ', '|' and ',') Standalone OptionType = 3 // Standalone denotes a boolean Flag (does not accept a value) File OptionType = 4 // File denotes a Flag which is evaluated as a path (the content of the file is treated as the value) )
func (OptionType) String ¶ added in v1.9.5
func (o OptionType) String() string
String returns the string representation of an OptionType
type PatternValue ¶
PatternValue is used to define an acceptable value for a Flag. The 'pattern' argument is compiled to a regular expression and the description argument is used to provide a human-readable description of the pattern.
func (*PatternValue) Describe ¶
func (r *PatternValue) Describe() string
Describe a PatternValue (regular expression with a human-readable explanation of the pattern)
type Secure ¶
Secure set to Secure to true to solicit non-echoed user input from stdin. If Prompt is empty a "password :" prompt will be displayed. Set to the desired value to override.
type TagConfig ¶
type TagConfig struct { Kind Kind Name string Short string TypeOf OptionType Description string Default string Required bool Secure Secure Path string AcceptedValues []PatternValue DependsOn map[string][]string Capacity int Position *int }
TagConfig is used to store struct tag information about a flag or command