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 ( FormatFlagName = "format" FormatCSV = "csv" FormatJSON = "json" FormatPlain = "plain" )
const FieldSep = ","
FieldSep specifies the separator when passing multiple values to the flag
const TaskStatusFormatDescription string = "one of " +
taskStatusExist + ", " +
taskStatusPending
TaskStatusFormatDescription is the format description for the flag
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 flag that accept a comma-separated list of field names. The passed values are case-insensitive.
func MustNewFields ¶
MustNewFields returns a new flag that supports the passed fields. The default value of the flag is specified by defaultFields. If an element is in defaultFields but not in supportedFields the function panics.
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) String ¶
String returns the list of enabled fields. It is used to show the default value in the usage output.
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 OneOf ¶
type OneOf struct { Val string // contains filtered or unexported fields }
OneOf is a command line flag that accepts one of multiple possible values.
func NewFormatFlag ¶
func NewFormatFlag() *OneOf
func NewOneOfFlag ¶
func (*OneOf) RegisterFlagCompletion ¶
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.
type TaskStatus ¶
type TaskStatus struct { Status baur.TaskStatus // contains filtered or unexported fields }
TaskStatus is a commandline parameter to specify build status filters
func (*TaskStatus) IsSet ¶
func (b *TaskStatus) IsSet() bool
IsSet returns true if the flag parsed a commandline value (Set() was called)
func (*TaskStatus) Set ¶
func (b *TaskStatus) Set(val string) error
Set parses the passed string and sets the SortFlagValue
func (*TaskStatus) String ¶
func (b *TaskStatus) String() string
String returns the default value in the usage output
func (*TaskStatus) Type ¶
func (b *TaskStatus) Type() string
Type returns the format description of the flag