Documentation ¶
Overview ¶
Package xflag is an abstraction around the Go's standard "flag" package, INI or other configuration files, and environment variables.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
type Context struct { // Separator is a string that separates different objects or // section from key in flag names. // By default ":" is used as a separator if Context is allocated // using the New constructor. // Flag name with the separator may look as "mySection:myKey". Separator string // ArrLiteral is a string that is if included at the end of a flag // name means that the flag must be treated as an array rather than // as a scalar type. // By default "[]" is used as an array literal if Context is allocated // using the New constructor. // Flag name with the array literal may look as "mySection:myKey[]". ArrLiteral string // contains filtered or unexported fields }
Context represents a single instance of xflag. It contains available arguments and parsed configuration files.
func New ¶
New allocates and returns a new Context. A slice of input arguments should not include the command name.
func (*Context) Files ¶
Files method gets a number of INI configuration files and parses them. An error is returned if some of the files do not exist or their format is not valid. Every subsequent file overrides conflicting values of the previous one.
Directories ¶
Path | Synopsis |
---|---|
Package cflag is an extension to the standard flag package that brings support of complex types.
|
Package cflag is an extension to the standard flag package that brings support of complex types. |
types
Package types implements flag.Value interface for a number of complex types such as []string, []int, []bool, etc.
|
Package types implements flag.Value interface for a number of complex types such as []string, []int, []bool, etc. |
Click to show internal directories.
Click to hide internal directories.