Documentation
¶
Index ¶
Constants ¶
const ( // DateTimeFormat describes a short format supported by the flag DateTimeFormat = "2006.01.02-15:04" // DateTimeFormatTz describes long format supported by the flag DateTimeFormatTz = "2006.01.02-15:04:05-MST" // DateTimeExampleFormat is an exemplary valid datetime flag DateTimeExampleFormat = "2006.01.28-15:30" // DateTimeFormatDescr contains a description of the supported formats DateTimeFormatDescr = "YYYY.MM.DD-HH:MM[:SS-TZ]" )
const BuildStatusFormatDescription string = "one of " +
buildStatusExist + ", " +
buildStatusPending + ", " +
buildStatusInputUndefined + ", " +
buildStatusBuildCommandUndefined
BuildStatusFormatDescription is the format description for the flag
const FieldSep = ","
FieldSep specifies the separator when passing multiple values to the flag
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildStatus ¶
type BuildStatus struct { Status baur.BuildStatus // contains filtered or unexported fields }
BuildStatus is a commandline parameter to specify build status filters
func (*BuildStatus) IsSet ¶
func (b *BuildStatus) IsSet() bool
IsSet returns true if the flag parsed a commandline value (Set() was called)
func (*BuildStatus) Set ¶
func (b *BuildStatus) Set(val string) error
Set parses the passed string and sets the SortFlagValue
func (*BuildStatus) String ¶
func (b *BuildStatus) String() string
String returns the default value in the usage output
func (*BuildStatus) Type ¶
func (b *BuildStatus) Type() string
Type returns the format description of the flag
func (*BuildStatus) Usage ¶
func (b *BuildStatus) Usage(highlightFn func(a ...interface{}) string) string
Usage returns a usage description, important parts are passed through highlightFn
type DateTimeFlagValue ¶
DateTimeFlagValue is the DateTime pflag flag
func (*DateTimeFlagValue) Set ¶
func (v *DateTimeFlagValue) Set(timeStr string) error
Set implements the pflag.Value interface
func (*DateTimeFlagValue) String ¶
func (v *DateTimeFlagValue) String() string
String returns the default value in the usage output
func (*DateTimeFlagValue) Type ¶
func (*DateTimeFlagValue) Type() string
Type returns the value description string
type Fields ¶
type Fields struct { Fields []string // contains filtered or unexported fields }
Fields is a commandline flag that allows to enable one or more boolean fields by passing them in a format like "-f id,duration,path". The passed values are case-insensitive.
func (*Fields) Set ¶
Set parses a list of fields, fields contained in the string are set to true, all others are set to fault. If an unrecognized option value is passed a error is returned
func (*Fields) Usage ¶
Usage returns a usage description, important parts are passed through highlightFn
func (*Fields) ValidValues ¶
ValidValues returns the values that the flag accepts
type Sort ¶
Sort is a commandline flag to specify via which field and in which order output should be sorted
func NewSort ¶
NewSort returns a Sort flag. The keys in the validFields maps are accepted as value for Fields and map to the storage.Field values.