Documentation ¶
Index ¶
- func EnvBoolDefault(key string, def bool) bool
- func EnvDefault(key, def string) string
- func EnvDurationDefault(key string, def time.Duration) time.Duration
- type BoolVar
- type BoolVarP
- type DurationVar
- type DurationVarP
- type EnumSingleVar
- type EnumSingleVarP
- type EnumVar
- type EnumVarP
- type FlagExample
- type FlagValue
- type FlagVisibility
- type Float64Var
- type Float64VarP
- type Int64Var
- type Int64VarP
- type IntVar
- type IntVarP
- type Set
- func (f *Set) BoolVar(i *BoolVar)
- func (f *Set) BoolVarP(i *BoolVarP)
- func (f *Set) DurationVar(i *DurationVar)
- func (f *Set) DurationVarP(i *DurationVarP)
- func (f *Set) EnumSingleVar(i *EnumSingleVar)
- func (f *Set) EnumSingleVarP(i *EnumSingleVarP)
- func (f *Set) EnumVar(i *EnumVar)
- func (f *Set) EnumVarP(i *EnumVarP)
- func (f *Set) Float64Var(i *Float64Var)
- func (f *Set) Float64VarP(i *Float64VarP)
- func (f *Set) Int64Var(i *Int64Var)
- func (f *Set) Int64VarP(i *Int64VarP)
- func (f *Set) IntVar(i *IntVar)
- func (f *Set) IntVarP(i *IntVarP)
- func (f *Set) Name() string
- func (f *Set) StringMapVar(i *StringMapVar)
- func (f *Set) StringMapVarP(i *StringMapVarP)
- func (f *Set) StringSliceVar(i *StringSliceVar)
- func (f *Set) StringSliceVarP(i *StringSliceVarP)
- func (f *Set) StringVar(i *StringVar)
- func (f *Set) StringVarP(i *StringVarP)
- func (f *Set) Uint64Var(i *Uint64Var)
- func (f *Set) Uint64VarP(i *Uint64VarP)
- func (f *Set) UintVar(i *UintVar)
- func (f *Set) UintVarP(i *UintVarP)
- func (f *Set) Var(value flag.Value, name, usage string)
- func (f *Set) VarFlag(i *VarFlag)
- func (f *Set) VarFlagP(i *VarFlagP)
- func (f *Set) VarP(value flag.Value, name, shorthand, usage string)
- func (f *Set) Visit(fn func(*flag.Flag))
- func (f *Set) VisitAll(fn func(*flag.Flag))
- func (f *Set) VisitVars(fn func(*VarFlagP))
- type Sets
- func (f *Sets) Args() []string
- func (f *Sets) Completions() complete.Flags
- func (fs *Sets) Help() string
- func (fs *Sets) HideUnusedFlags(setName string, flagNames []string)
- func (f *Sets) NewSet(name string) *Set
- func (f *Sets) Parse(args []string) error
- func (f *Sets) Parsed() bool
- func (f *Sets) UsesGoflags() bool
- func (f *Sets) Visit(fn func(*flag.Flag))
- func (fs *Sets) VisitSets(fn func(name string, set *Set))
- type StringMapVar
- type StringMapVarP
- type StringSliceVar
- type StringSliceVarP
- type StringVar
- type StringVarP
- type Uint64Var
- type Uint64VarP
- type UintVar
- type UintVarP
- type VarFlag
- type VarFlagP
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnvBoolDefault ¶
func EnvDefault ¶
Types ¶
type BoolVar ¶
type BoolVar struct { Name string Aliases []string Usage string Default bool Hidden bool EnvVar string Target *bool Completion complete.Predictor SetHook func(val bool) }
-- BoolVar and boolValue
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 and durationValue
type DurationVarP ¶
type DurationVarP struct { *DurationVar Shorthand string }
type EnumSingleVar ¶
type EnumSingleVar struct { Name string Aliases []string Usage string Values []string Default string Hidden bool EnvVar string Target *string SetHook func(val string) Completion complete.Predictor }
-- EnumVar and enumValue
type EnumSingleVarP ¶
type EnumSingleVarP struct { *EnumSingleVar Shorthand string }
type EnumVar ¶
type EnumVar struct { Name string Aliases []string Usage string Values []string Default []string Hidden bool EnvVar string Target *[]string Completion complete.Predictor }
-- EnumVar and enumValue
type FlagExample ¶
type FlagExample interface {
Example() string
}
FlagExample is an interface which declares an example value. This is used in help generation to provide better help text.
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 and float64Value
type Float64VarP ¶
type Float64VarP struct { *Float64Var Shorthand string }
type Int64Var ¶
type Int64Var struct { Name string Aliases []string Usage string Default int64 Hidden bool EnvVar string Target *int64 Completion complete.Predictor SetHook func(val int64) }
-- Int64Var and int64Value
type IntVar ¶
type IntVar struct { Name string Aliases []string Usage string Default int Hidden bool EnvVar string Target *int Completion complete.Predictor SetHook func(val int) }
-- IntVar and intValue
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set is a grouped wrapper around a real flag set and a grouped flag set.
func (*Set) DurationVar ¶
func (f *Set) DurationVar(i *DurationVar)
func (*Set) DurationVarP ¶
func (f *Set) DurationVarP(i *DurationVarP)
func (*Set) EnumSingleVar ¶
func (f *Set) EnumSingleVar(i *EnumSingleVar)
func (*Set) EnumSingleVarP ¶
func (f *Set) EnumSingleVarP(i *EnumSingleVarP)
func (*Set) Float64Var ¶
func (f *Set) Float64Var(i *Float64Var)
func (*Set) Float64VarP ¶
func (f *Set) Float64VarP(i *Float64VarP)
func (*Set) StringMapVar ¶
func (f *Set) StringMapVar(i *StringMapVar)
func (*Set) StringMapVarP ¶
func (f *Set) StringMapVarP(i *StringMapVarP)
func (*Set) StringSliceVar ¶
func (f *Set) StringSliceVar(i *StringSliceVar)
func (*Set) StringSliceVarP ¶
func (f *Set) StringSliceVarP(i *StringSliceVarP)
func (*Set) StringVarP ¶
func (f *Set) StringVarP(i *StringVarP)
func (*Set) Uint64VarP ¶
func (f *Set) Uint64VarP(i *Uint64VarP)
type Sets ¶
type Sets struct {
// contains filtered or unexported fields
}
Sets is a group of flag sets.
func (*Sets) Completions ¶
Completions returns the completions for this flag set.
func (*Sets) HideUnusedFlags ¶
TODO make this less horrendous my eyes are bleeding
func (*Sets) NewSet ¶
NewSet creates a new single flag set. A set should be created for any grouping of flags, for example "Common Options", "Auth Options", etc.
func (*Sets) Parse ¶
Parse parses the given flags, returning any errors. It does a naive check for std lib flags to determine which flag set to parse.
func (*Sets) UsesGoflags ¶
Returns whether the command is using the parsed goflag set or posix set
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 and stringMapValue
type StringMapVarP ¶
type StringMapVarP struct { *StringMapVar Shorthand string }
type StringSliceVar ¶
type StringSliceVar struct { Name string Aliases []string Usage string Default []string Hidden bool EnvVar string Target *[]string Completion complete.Predictor }
-- StringSliceVar and stringSliceValue
type StringSliceVarP ¶
type StringSliceVarP struct { *StringSliceVar Shorthand string }
type StringVar ¶
type StringVar struct { Name string Aliases []string Usage string Default string Hidden bool EnvVar string Target *string Completion complete.Predictor SetHook func(val string) }
-- StringVar and stringValue
type StringVarP ¶
type Uint64Var ¶
type Uint64Var struct { Name string Aliases []string Usage string Default uint64 Hidden bool EnvVar string Target *uint64 Completion complete.Predictor SetHook func(val uint64) }
-- Uint64Var and uint64Value
type Uint64VarP ¶
type UintVar ¶
type UintVar struct { Name string Aliases []string Usage string Default uint Hidden bool EnvVar string Target *uint Completion complete.Predictor SetHook func(val uint) }
-- UintVar && uintValue