Documentation
¶
Index ¶
- Constants
- type BoolVar
- type DurationVar
- type FlagBool
- type FlagExample
- type FlagSet
- func (f *FlagSet) BoolVar(i *BoolVar)
- func (f *FlagSet) DurationVar(i *DurationVar)
- func (f *FlagSet) Float64Var(i *Float64Var)
- func (f *FlagSet) Int64Var(i *Int64Var)
- func (f *FlagSet) IntVar(i *IntVar)
- func (f *FlagSet) Name() string
- func (f *FlagSet) StringMapVar(i *StringMapVar)
- func (f *FlagSet) StringSliceVar(i *StringSliceVar)
- func (f *FlagSet) StringVar(i *StringVar)
- func (f *FlagSet) Uint64Var(i *Uint64Var)
- func (f *FlagSet) UintVar(i *UintVar)
- func (f *FlagSet) Var(value flag.Value, name, usage string)
- func (f *FlagSet) VarFlag(i *VarFlag)
- func (f *FlagSet) Visit(fn func(*flag.Flag))
- func (f *FlagSet) VisitAll(fn func(*flag.Flag))
- type FlagSets
- type FlagVisibility
- type Float64Var
- type Int64Var
- type IntVar
- type StringMapVar
- type StringSliceVar
- type StringVar
- type Uint64Var
- type UintVar
- type VarFlag
Constants ¶
const ( // MaxLineLength is the maximum width of any line. MaxLineLength int = 78 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoolVar ¶
type BoolVar struct { Name string Aliases []string Usage string Default bool Hidden bool EnvVar string Target *bool Completion complete.Predictor }
BoolVar is a structure to define a bool flag
type DurationVar ¶
type DurationVar struct { Name string Aliases []string Usage string Default time.Duration Hidden bool EnvVar string Target *time.Duration Completion complete.Predictor }
DurationVar is a structure to define a duration flag
type FlagBool ¶
type FlagBool interface {
IsBoolFlag() bool
}
FlagBool is an interface which boolean flags implement.
type FlagExample ¶
type FlagExample interface {
Example() string
}
FlagExample is an interface which declares an example value.
type FlagSet ¶
type FlagSet struct {
// contains filtered or unexported fields
}
FlagSet is a grouped wrapper around a real flag set and a grouped flag set.
func (*FlagSet) DurationVar ¶
func (f *FlagSet) DurationVar(i *DurationVar)
DurationVar -- add a DurationVar in a FlagSet
func (*FlagSet) Float64Var ¶
func (f *FlagSet) Float64Var(i *Float64Var)
Float64Var -- add a Float64Var in a FlagSet
func (*FlagSet) StringMapVar ¶
func (f *FlagSet) StringMapVar(i *StringMapVar)
StringMapVar -- add a StringMap in a FlagSet
func (*FlagSet) StringSliceVar ¶
func (f *FlagSet) StringSliceVar(i *StringSliceVar)
StringSliceVar -- add a StringSliceVar in a FlagSet
func (*FlagSet) Var ¶
Var is a lower-level API for adding something to the flags. It should be used with caution, since it bypasses all validation. Consider VarFlag instead.
type FlagSets ¶
type FlagSets struct {
// contains filtered or unexported fields
}
FlagSets is a group of flag sets.
func (*FlagSets) Completions ¶
Completions returns the completions for this flag set.
func (*FlagSets) NewFlagSet ¶
NewFlagSet creates a new flag set from the given flag sets.
type FlagVisibility ¶
type FlagVisibility interface {
Hidden() bool
}
FlagVisibility is an interface which declares whether a flag should be hidden from help and completions. This is usually used for deprecations on "internal-only" flags.
type Float64Var ¶
type Float64Var struct { Name string Aliases []string Usage string Default float64 Hidden bool EnvVar string Target *float64 Completion complete.Predictor }
Float64Var is a structure to define a float64 flag
type Int64Var ¶
type Int64Var struct { Name string Aliases []string Usage string Default int64 Hidden bool EnvVar string Target *int64 Completion complete.Predictor }
Int64Var is a structure to define a int64 flag
type IntVar ¶
type IntVar struct { Name string Aliases []string Usage string Default int Hidden bool EnvVar string Target *int Completion complete.Predictor }
IntVar is a structure to define a integer flag
type StringMapVar ¶
type StringMapVar struct { Name string Aliases []string Usage string Default map[string]string Hidden bool Target *map[string]string Completion complete.Predictor }
StringMapVar is a structure to define a string map flag
type StringSliceVar ¶
type StringSliceVar struct { Name string Aliases []string Usage string Default []string Hidden bool EnvVar string Target *[]string Completion complete.Predictor }
StringSliceVar is a structure to define a slice of string flag
type StringVar ¶
type StringVar struct { Name string Aliases []string Usage string Default string Hidden bool EnvVar string Target *string Completion complete.Predictor }
StringVar is a structure to define a string flag
type Uint64Var ¶
type Uint64Var struct { Name string Aliases []string Usage string Default uint64 Hidden bool EnvVar string Target *uint64 Completion complete.Predictor }
Uint64Var is a structure to define a unsigned int64 flag