|
|
|
@ -240,6 +240,7 @@ type BoolFlag struct {
|
|
|
|
|
Name string
|
|
|
|
|
Usage string
|
|
|
|
|
EnvVar string
|
|
|
|
|
Destination *bool
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// String returns a readable representation of this value (for usage defaults)
|
|
|
|
@ -264,6 +265,10 @@ func (f BoolFlag) Apply(set *flag.FlagSet) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
eachName(f.Name, func(name string) {
|
|
|
|
|
if f.Destination != nil {
|
|
|
|
|
set.BoolVar(f.Destination, name, val, f.Usage)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
set.Bool(name, val, f.Usage)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
@ -278,6 +283,7 @@ type BoolTFlag struct {
|
|
|
|
|
Name string
|
|
|
|
|
Usage string
|
|
|
|
|
EnvVar string
|
|
|
|
|
Destination *bool
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// String returns a readable representation of this value (for usage defaults)
|
|
|
|
@ -302,6 +308,10 @@ func (f BoolTFlag) Apply(set *flag.FlagSet) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
eachName(f.Name, func(name string) {
|
|
|
|
|
if f.Destination != nil {
|
|
|
|
|
set.BoolVar(f.Destination, name, val, f.Usage)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
set.Bool(name, val, f.Usage)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
@ -316,6 +326,7 @@ type StringFlag struct {
|
|
|
|
|
Value string
|
|
|
|
|
Usage string
|
|
|
|
|
EnvVar string
|
|
|
|
|
Destination *string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// String returns the usage
|
|
|
|
@ -345,6 +356,10 @@ func (f StringFlag) Apply(set *flag.FlagSet) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
eachName(f.Name, func(name string) {
|
|
|
|
|
if f.Destination != nil {
|
|
|
|
|
set.StringVar(f.Destination, name, f.Value, f.Usage)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
set.String(name, f.Value, f.Usage)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
@ -360,6 +375,7 @@ type IntFlag struct {
|
|
|
|
|
Value int
|
|
|
|
|
Usage string
|
|
|
|
|
EnvVar string
|
|
|
|
|
Destination *int
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// String returns the usage
|
|
|
|
@ -383,6 +399,10 @@ func (f IntFlag) Apply(set *flag.FlagSet) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
eachName(f.Name, func(name string) {
|
|
|
|
|
if f.Destination != nil {
|
|
|
|
|
set.IntVar(f.Destination, name, f.Value, f.Usage)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
set.Int(name, f.Value, f.Usage)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
@ -398,6 +418,7 @@ type DurationFlag struct {
|
|
|
|
|
Value time.Duration
|
|
|
|
|
Usage string
|
|
|
|
|
EnvVar string
|
|
|
|
|
Destination *time.Duration
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// String returns a readable representation of this value (for usage defaults)
|
|
|
|
@ -421,6 +442,10 @@ func (f DurationFlag) Apply(set *flag.FlagSet) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
eachName(f.Name, func(name string) {
|
|
|
|
|
if f.Destination != nil {
|
|
|
|
|
set.DurationVar(f.Destination, name, f.Value, f.Usage)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
set.Duration(name, f.Value, f.Usage)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
@ -436,6 +461,7 @@ type Float64Flag struct {
|
|
|
|
|
Value float64
|
|
|
|
|
Usage string
|
|
|
|
|
EnvVar string
|
|
|
|
|
Destination *float64
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// String returns the usage
|
|
|
|
@ -458,6 +484,10 @@ func (f Float64Flag) Apply(set *flag.FlagSet) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
eachName(f.Name, func(name string) {
|
|
|
|
|
if f.Destination != nil {
|
|
|
|
|
set.Float64Var(f.Destination, name, f.Value, f.Usage)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
set.Float64(name, f.Value, f.Usage)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|