Cleanup: Collapse flag interfaces
This commit is contained in:
parent
321610437e
commit
ab68d8a69d
16
app_test.go
16
app_test.go
@ -2252,6 +2252,22 @@ func (c *customBoolFlag) IsSet() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *customBoolFlag) IsRequired() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *customBoolFlag) IsVisible() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *customBoolFlag) GetCategory() string {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *customBoolFlag) GetEnvVars() []string {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func TestCustomFlagsUnused(t *testing.T) {
|
func TestCustomFlagsUnused(t *testing.T) {
|
||||||
app := &App{
|
app := &App{
|
||||||
Flags: []Flag{&customBoolFlag{"custom"}},
|
Flags: []Flag{&customBoolFlag{"custom"}},
|
||||||
|
21
flag.go
21
flag.go
@ -93,14 +93,20 @@ type Flag interface {
|
|||||||
Apply(*flag.FlagSet) error
|
Apply(*flag.FlagSet) error
|
||||||
Names() []string
|
Names() []string
|
||||||
IsSet() bool
|
IsSet() bool
|
||||||
|
IsRequired() bool
|
||||||
|
// IsVisible returns true if the flag is not hidden, otherwise false
|
||||||
|
IsVisible() bool
|
||||||
|
GetCategory() string
|
||||||
|
// GetUsage returns the usage string for the flag
|
||||||
|
GetUsage() string
|
||||||
|
// GetEnvVars returns the env vars for this flag
|
||||||
|
GetEnvVars() []string
|
||||||
}
|
}
|
||||||
|
|
||||||
// RequiredFlag is an interface that allows us to mark flags as required
|
// RequiredFlag is an interface that allows us to mark flags as required
|
||||||
// it allows flags required flags to be backwards compatible with the Flag interface
|
// it allows flags required flags to be backwards compatible with the Flag interface
|
||||||
type RequiredFlag interface {
|
type RequiredFlag interface {
|
||||||
Flag
|
Flag
|
||||||
|
|
||||||
IsRequired() bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// DocGenerationFlag is an interface that allows documentation generation for the flag
|
// DocGenerationFlag is an interface that allows documentation generation for the flag
|
||||||
@ -110,34 +116,23 @@ type DocGenerationFlag interface {
|
|||||||
// TakesValue returns true if the flag takes a value, otherwise false
|
// TakesValue returns true if the flag takes a value, otherwise false
|
||||||
TakesValue() bool
|
TakesValue() bool
|
||||||
|
|
||||||
// GetUsage returns the usage string for the flag
|
|
||||||
GetUsage() string
|
|
||||||
|
|
||||||
// GetValue returns the flags value as string representation and an empty
|
// GetValue returns the flags value as string representation and an empty
|
||||||
// string if the flag takes no value at all.
|
// string if the flag takes no value at all.
|
||||||
GetValue() string
|
GetValue() string
|
||||||
|
|
||||||
// GetDefaultText returns the default text for this flag
|
// GetDefaultText returns the default text for this flag
|
||||||
GetDefaultText() string
|
GetDefaultText() string
|
||||||
|
|
||||||
// GetEnvVars returns the env vars for this flag
|
|
||||||
GetEnvVars() []string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// VisibleFlag is an interface that allows to check if a flag is visible
|
// VisibleFlag is an interface that allows to check if a flag is visible
|
||||||
type VisibleFlag interface {
|
type VisibleFlag interface {
|
||||||
Flag
|
Flag
|
||||||
|
|
||||||
// IsVisible returns true if the flag is not hidden, otherwise false
|
|
||||||
IsVisible() bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CategorizableFlag is an interface that allows us to potentially
|
// CategorizableFlag is an interface that allows us to potentially
|
||||||
// use a flag in a categorized representation.
|
// use a flag in a categorized representation.
|
||||||
type CategorizableFlag interface {
|
type CategorizableFlag interface {
|
||||||
VisibleFlag
|
VisibleFlag
|
||||||
|
|
||||||
GetCategory() string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func flagSet(name string, flags []Flag) (*flag.FlagSet, error) {
|
func flagSet(name string, flags []Flag) (*flag.FlagSet, error) {
|
||||||
|
20
flag_bool.go
20
flag_bool.go
@ -6,21 +6,6 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TakesValue returns true of the flag takes a value, otherwise false
|
|
||||||
func (f *BoolFlag) TakesValue() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetUsage returns the usage string for the flag
|
|
||||||
func (f *BoolFlag) GetUsage() string {
|
|
||||||
return f.Usage
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetCategory returns the category for the flag
|
|
||||||
func (f *BoolFlag) GetCategory() string {
|
|
||||||
return f.Category
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetValue returns the flags value as string representation and an empty
|
// GetValue returns the flags value as string representation and an empty
|
||||||
// string if the flag takes no value at all.
|
// string if the flag takes no value at all.
|
||||||
func (f *BoolFlag) GetValue() string {
|
func (f *BoolFlag) GetValue() string {
|
||||||
@ -35,11 +20,6 @@ func (f *BoolFlag) GetDefaultText() string {
|
|||||||
return fmt.Sprintf("%v", f.Value)
|
return fmt.Sprintf("%v", f.Value)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetEnvVars returns the env vars for this flag
|
|
||||||
func (f *BoolFlag) GetEnvVars() []string {
|
|
||||||
return f.EnvVars
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply populates the flag given the flag set and environment
|
// Apply populates the flag given the flag set and environment
|
||||||
func (f *BoolFlag) Apply(set *flag.FlagSet) error {
|
func (f *BoolFlag) Apply(set *flag.FlagSet) error {
|
||||||
if val, source, found := flagFromEnvOrFile(f.EnvVars, f.FilePath); found {
|
if val, source, found := flagFromEnvOrFile(f.EnvVars, f.FilePath); found {
|
||||||
|
@ -6,21 +6,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TakesValue returns true of the flag takes a value, otherwise false
|
|
||||||
func (f *DurationFlag) TakesValue() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetUsage returns the usage string for the flag
|
|
||||||
func (f *DurationFlag) GetUsage() string {
|
|
||||||
return f.Usage
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetCategory returns the category for the flag
|
|
||||||
func (f *DurationFlag) GetCategory() string {
|
|
||||||
return f.Category
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetValue returns the flags value as string representation and an empty
|
// GetValue returns the flags value as string representation and an empty
|
||||||
// string if the flag takes no value at all.
|
// string if the flag takes no value at all.
|
||||||
func (f *DurationFlag) GetValue() string {
|
func (f *DurationFlag) GetValue() string {
|
||||||
@ -35,11 +20,6 @@ func (f *DurationFlag) GetDefaultText() string {
|
|||||||
return f.GetValue()
|
return f.GetValue()
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetEnvVars returns the env vars for this flag
|
|
||||||
func (f *DurationFlag) GetEnvVars() []string {
|
|
||||||
return f.EnvVars
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply populates the flag given the flag set and environment
|
// Apply populates the flag given the flag set and environment
|
||||||
func (f *DurationFlag) Apply(set *flag.FlagSet) error {
|
func (f *DurationFlag) Apply(set *flag.FlagSet) error {
|
||||||
if val, source, found := flagFromEnvOrFile(f.EnvVars, f.FilePath); found {
|
if val, source, found := flagFromEnvOrFile(f.EnvVars, f.FilePath); found {
|
||||||
|
@ -6,21 +6,6 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TakesValue returns true of the flag takes a value, otherwise false
|
|
||||||
func (f *Float64Flag) TakesValue() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetUsage returns the usage string for the flag
|
|
||||||
func (f *Float64Flag) GetUsage() string {
|
|
||||||
return f.Usage
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetCategory returns the category for the flag
|
|
||||||
func (f *Float64Flag) GetCategory() string {
|
|
||||||
return f.Category
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetValue returns the flags value as string representation and an empty
|
// GetValue returns the flags value as string representation and an empty
|
||||||
// string if the flag takes no value at all.
|
// string if the flag takes no value at all.
|
||||||
func (f *Float64Flag) GetValue() string {
|
func (f *Float64Flag) GetValue() string {
|
||||||
@ -35,11 +20,6 @@ func (f *Float64Flag) GetDefaultText() string {
|
|||||||
return f.GetValue()
|
return f.GetValue()
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetEnvVars returns the env vars for this flag
|
|
||||||
func (f *Float64Flag) GetEnvVars() []string {
|
|
||||||
return f.EnvVars
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply populates the flag given the flag set and environment
|
// Apply populates the flag given the flag set and environment
|
||||||
func (f *Float64Flag) Apply(set *flag.FlagSet) error {
|
func (f *Float64Flag) Apply(set *flag.FlagSet) error {
|
||||||
if val, source, found := flagFromEnvOrFile(f.EnvVars, f.FilePath); found {
|
if val, source, found := flagFromEnvOrFile(f.EnvVars, f.FilePath); found {
|
||||||
|
@ -86,21 +86,6 @@ func (f *Float64SliceFlag) String() string {
|
|||||||
return withEnvHint(f.GetEnvVars(), stringifyFloat64SliceFlag(f))
|
return withEnvHint(f.GetEnvVars(), stringifyFloat64SliceFlag(f))
|
||||||
}
|
}
|
||||||
|
|
||||||
// TakesValue returns true if the flag takes a value, otherwise false
|
|
||||||
func (f *Float64SliceFlag) TakesValue() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetUsage returns the usage string for the flag
|
|
||||||
func (f *Float64SliceFlag) GetUsage() string {
|
|
||||||
return f.Usage
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetCategory returns the category for the flag
|
|
||||||
func (f *Float64SliceFlag) GetCategory() string {
|
|
||||||
return f.Category
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetValue returns the flags value as string representation and an empty
|
// GetValue returns the flags value as string representation and an empty
|
||||||
// string if the flag takes no value at all.
|
// string if the flag takes no value at all.
|
||||||
func (f *Float64SliceFlag) GetValue() string {
|
func (f *Float64SliceFlag) GetValue() string {
|
||||||
@ -118,11 +103,6 @@ func (f *Float64SliceFlag) GetDefaultText() string {
|
|||||||
return f.GetValue()
|
return f.GetValue()
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetEnvVars returns the env vars for this flag
|
|
||||||
func (f *Float64SliceFlag) GetEnvVars() []string {
|
|
||||||
return f.EnvVars
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply populates the flag given the flag set and environment
|
// Apply populates the flag given the flag set and environment
|
||||||
func (f *Float64SliceFlag) Apply(set *flag.FlagSet) error {
|
func (f *Float64SliceFlag) Apply(set *flag.FlagSet) error {
|
||||||
// apply any default
|
// apply any default
|
||||||
|
@ -11,21 +11,6 @@ type Generic interface {
|
|||||||
String() string
|
String() string
|
||||||
}
|
}
|
||||||
|
|
||||||
// TakesValue returns true of the flag takes a value, otherwise false
|
|
||||||
func (f *GenericFlag) TakesValue() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetUsage returns the usage string for the flag
|
|
||||||
func (f *GenericFlag) GetUsage() string {
|
|
||||||
return f.Usage
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetCategory returns the category for the flag
|
|
||||||
func (f *GenericFlag) GetCategory() string {
|
|
||||||
return f.Category
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetValue returns the flags value as string representation and an empty
|
// GetValue returns the flags value as string representation and an empty
|
||||||
// string if the flag takes no value at all.
|
// string if the flag takes no value at all.
|
||||||
func (f *GenericFlag) GetValue() string {
|
func (f *GenericFlag) GetValue() string {
|
||||||
@ -43,11 +28,6 @@ func (f *GenericFlag) GetDefaultText() string {
|
|||||||
return f.GetValue()
|
return f.GetValue()
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetEnvVars returns the env vars for this flag
|
|
||||||
func (f *GenericFlag) GetEnvVars() []string {
|
|
||||||
return f.EnvVars
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply takes the flagset and calls Set on the generic flag with the value
|
// Apply takes the flagset and calls Set on the generic flag with the value
|
||||||
// provided by the user for parsing by the flag
|
// provided by the user for parsing by the flag
|
||||||
func (f GenericFlag) Apply(set *flag.FlagSet) error {
|
func (f GenericFlag) Apply(set *flag.FlagSet) error {
|
||||||
|
20
flag_int.go
20
flag_int.go
@ -6,21 +6,6 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TakesValue returns true of the flag takes a value, otherwise false
|
|
||||||
func (f *IntFlag) TakesValue() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetUsage returns the usage string for the flag
|
|
||||||
func (f *IntFlag) GetUsage() string {
|
|
||||||
return f.Usage
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetCategory returns the category for the flag
|
|
||||||
func (f *IntFlag) GetCategory() string {
|
|
||||||
return f.Category
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetValue returns the flags value as string representation and an empty
|
// GetValue returns the flags value as string representation and an empty
|
||||||
// string if the flag takes no value at all.
|
// string if the flag takes no value at all.
|
||||||
func (f *IntFlag) GetValue() string {
|
func (f *IntFlag) GetValue() string {
|
||||||
@ -35,11 +20,6 @@ func (f *IntFlag) GetDefaultText() string {
|
|||||||
return f.GetValue()
|
return f.GetValue()
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetEnvVars returns the env vars for this flag
|
|
||||||
func (f *IntFlag) GetEnvVars() []string {
|
|
||||||
return f.EnvVars
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply populates the flag given the flag set and environment
|
// Apply populates the flag given the flag set and environment
|
||||||
func (f *IntFlag) Apply(set *flag.FlagSet) error {
|
func (f *IntFlag) Apply(set *flag.FlagSet) error {
|
||||||
if val, source, found := flagFromEnvOrFile(f.EnvVars, f.FilePath); found {
|
if val, source, found := flagFromEnvOrFile(f.EnvVars, f.FilePath); found {
|
||||||
|
@ -6,21 +6,6 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TakesValue returns true of the flag takes a value, otherwise false
|
|
||||||
func (f *Int64Flag) TakesValue() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetUsage returns the usage string for the flag
|
|
||||||
func (f *Int64Flag) GetUsage() string {
|
|
||||||
return f.Usage
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetCategory returns the category for the flag
|
|
||||||
func (f *Int64Flag) GetCategory() string {
|
|
||||||
return f.Category
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetValue returns the flags value as string representation and an empty
|
// GetValue returns the flags value as string representation and an empty
|
||||||
// string if the flag takes no value at all.
|
// string if the flag takes no value at all.
|
||||||
func (f *Int64Flag) GetValue() string {
|
func (f *Int64Flag) GetValue() string {
|
||||||
@ -35,11 +20,6 @@ func (f *Int64Flag) GetDefaultText() string {
|
|||||||
return f.GetValue()
|
return f.GetValue()
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetEnvVars returns the env vars for this flag
|
|
||||||
func (f *Int64Flag) GetEnvVars() []string {
|
|
||||||
return f.EnvVars
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply populates the flag given the flag set and environment
|
// Apply populates the flag given the flag set and environment
|
||||||
func (f *Int64Flag) Apply(set *flag.FlagSet) error {
|
func (f *Int64Flag) Apply(set *flag.FlagSet) error {
|
||||||
if val, source, found := flagFromEnvOrFile(f.EnvVars, f.FilePath); found {
|
if val, source, found := flagFromEnvOrFile(f.EnvVars, f.FilePath); found {
|
||||||
|
@ -87,21 +87,6 @@ func (f *Int64SliceFlag) String() string {
|
|||||||
return withEnvHint(f.GetEnvVars(), stringifyInt64SliceFlag(f))
|
return withEnvHint(f.GetEnvVars(), stringifyInt64SliceFlag(f))
|
||||||
}
|
}
|
||||||
|
|
||||||
// TakesValue returns true of the flag takes a value, otherwise false
|
|
||||||
func (f *Int64SliceFlag) TakesValue() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetUsage returns the usage string for the flag
|
|
||||||
func (f *Int64SliceFlag) GetUsage() string {
|
|
||||||
return f.Usage
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetCategory returns the category for the flag
|
|
||||||
func (f *Int64SliceFlag) GetCategory() string {
|
|
||||||
return f.Category
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetValue returns the flags value as string representation and an empty
|
// GetValue returns the flags value as string representation and an empty
|
||||||
// string if the flag takes no value at all.
|
// string if the flag takes no value at all.
|
||||||
func (f *Int64SliceFlag) GetValue() string {
|
func (f *Int64SliceFlag) GetValue() string {
|
||||||
@ -119,11 +104,6 @@ func (f *Int64SliceFlag) GetDefaultText() string {
|
|||||||
return f.GetValue()
|
return f.GetValue()
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetEnvVars returns the env vars for this flag
|
|
||||||
func (f *Int64SliceFlag) GetEnvVars() []string {
|
|
||||||
return f.EnvVars
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply populates the flag given the flag set and environment
|
// Apply populates the flag given the flag set and environment
|
||||||
func (f *Int64SliceFlag) Apply(set *flag.FlagSet) error {
|
func (f *Int64SliceFlag) Apply(set *flag.FlagSet) error {
|
||||||
// apply any default
|
// apply any default
|
||||||
|
@ -98,21 +98,6 @@ func (f *IntSliceFlag) String() string {
|
|||||||
return withEnvHint(f.GetEnvVars(), stringifyIntSliceFlag(f))
|
return withEnvHint(f.GetEnvVars(), stringifyIntSliceFlag(f))
|
||||||
}
|
}
|
||||||
|
|
||||||
// TakesValue returns true of the flag takes a value, otherwise false
|
|
||||||
func (f *IntSliceFlag) TakesValue() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetUsage returns the usage string for the flag
|
|
||||||
func (f *IntSliceFlag) GetUsage() string {
|
|
||||||
return f.Usage
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetCategory returns the category for the flag
|
|
||||||
func (f *IntSliceFlag) GetCategory() string {
|
|
||||||
return f.Category
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetValue returns the flags value as string representation and an empty
|
// GetValue returns the flags value as string representation and an empty
|
||||||
// string if the flag takes no value at all.
|
// string if the flag takes no value at all.
|
||||||
func (f *IntSliceFlag) GetValue() string {
|
func (f *IntSliceFlag) GetValue() string {
|
||||||
@ -130,11 +115,6 @@ func (f *IntSliceFlag) GetDefaultText() string {
|
|||||||
return f.GetValue()
|
return f.GetValue()
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetEnvVars returns the env vars for this flag
|
|
||||||
func (f *IntSliceFlag) GetEnvVars() []string {
|
|
||||||
return f.EnvVars
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply populates the flag given the flag set and environment
|
// Apply populates the flag given the flag set and environment
|
||||||
func (f *IntSliceFlag) Apply(set *flag.FlagSet) error {
|
func (f *IntSliceFlag) Apply(set *flag.FlagSet) error {
|
||||||
// apply any default
|
// apply any default
|
||||||
|
20
flag_path.go
20
flag_path.go
@ -7,21 +7,6 @@ import (
|
|||||||
|
|
||||||
type Path = string
|
type Path = string
|
||||||
|
|
||||||
// TakesValue returns true of the flag takes a value, otherwise false
|
|
||||||
func (f *PathFlag) TakesValue() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetUsage returns the usage string for the flag
|
|
||||||
func (f *PathFlag) GetUsage() string {
|
|
||||||
return f.Usage
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetCategory returns the category for the flag
|
|
||||||
func (f *PathFlag) GetCategory() string {
|
|
||||||
return f.Category
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetValue returns the flags value as string representation and an empty
|
// GetValue returns the flags value as string representation and an empty
|
||||||
// string if the flag takes no value at all.
|
// string if the flag takes no value at all.
|
||||||
func (f *PathFlag) GetValue() string {
|
func (f *PathFlag) GetValue() string {
|
||||||
@ -39,11 +24,6 @@ func (f *PathFlag) GetDefaultText() string {
|
|||||||
return fmt.Sprintf("%q", f.Value)
|
return fmt.Sprintf("%q", f.Value)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetEnvVars returns the env vars for this flag
|
|
||||||
func (f *PathFlag) GetEnvVars() []string {
|
|
||||||
return f.EnvVars
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply populates the flag given the flag set and environment
|
// Apply populates the flag given the flag set and environment
|
||||||
func (f *PathFlag) Apply(set *flag.FlagSet) error {
|
func (f *PathFlag) Apply(set *flag.FlagSet) error {
|
||||||
if val, _, found := flagFromEnvOrFile(f.EnvVars, f.FilePath); found {
|
if val, _, found := flagFromEnvOrFile(f.EnvVars, f.FilePath); found {
|
||||||
|
@ -5,21 +5,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TakesValue returns true of the flag takes a value, otherwise false
|
|
||||||
func (f *StringFlag) TakesValue() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetUsage returns the usage string for the flag
|
|
||||||
func (f *StringFlag) GetUsage() string {
|
|
||||||
return f.Usage
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetCategory returns the category for the flag
|
|
||||||
func (f *StringFlag) GetCategory() string {
|
|
||||||
return f.Category
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetValue returns the flags value as string representation and an empty
|
// GetValue returns the flags value as string representation and an empty
|
||||||
// string if the flag takes no value at all.
|
// string if the flag takes no value at all.
|
||||||
func (f *StringFlag) GetValue() string {
|
func (f *StringFlag) GetValue() string {
|
||||||
@ -37,11 +22,6 @@ func (f *StringFlag) GetDefaultText() string {
|
|||||||
return fmt.Sprintf("%q", f.Value)
|
return fmt.Sprintf("%q", f.Value)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetEnvVars returns the env vars for this flag
|
|
||||||
func (f *StringFlag) GetEnvVars() []string {
|
|
||||||
return f.EnvVars
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply populates the flag given the flag set and environment
|
// Apply populates the flag given the flag set and environment
|
||||||
func (f *StringFlag) Apply(set *flag.FlagSet) error {
|
func (f *StringFlag) Apply(set *flag.FlagSet) error {
|
||||||
if val, _, found := flagFromEnvOrFile(f.EnvVars, f.FilePath); found {
|
if val, _, found := flagFromEnvOrFile(f.EnvVars, f.FilePath); found {
|
||||||
|
@ -76,21 +76,6 @@ func (f *StringSliceFlag) String() string {
|
|||||||
return withEnvHint(f.GetEnvVars(), stringifyStringSliceFlag(f))
|
return withEnvHint(f.GetEnvVars(), stringifyStringSliceFlag(f))
|
||||||
}
|
}
|
||||||
|
|
||||||
// TakesValue returns true of the flag takes a value, otherwise false
|
|
||||||
func (f *StringSliceFlag) TakesValue() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetUsage returns the usage string for the flag
|
|
||||||
func (f *StringSliceFlag) GetUsage() string {
|
|
||||||
return f.Usage
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetCategory returns the category for the flag
|
|
||||||
func (f *StringSliceFlag) GetCategory() string {
|
|
||||||
return f.Category
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetValue returns the flags value as string representation and an empty
|
// GetValue returns the flags value as string representation and an empty
|
||||||
// string if the flag takes no value at all.
|
// string if the flag takes no value at all.
|
||||||
func (f *StringSliceFlag) GetValue() string {
|
func (f *StringSliceFlag) GetValue() string {
|
||||||
@ -108,11 +93,6 @@ func (f *StringSliceFlag) GetDefaultText() string {
|
|||||||
return f.GetValue()
|
return f.GetValue()
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetEnvVars returns the env vars for this flag
|
|
||||||
func (f *StringSliceFlag) GetEnvVars() []string {
|
|
||||||
return f.EnvVars
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply populates the flag given the flag set and environment
|
// Apply populates the flag given the flag set and environment
|
||||||
func (f *StringSliceFlag) Apply(set *flag.FlagSet) error {
|
func (f *StringSliceFlag) Apply(set *flag.FlagSet) error {
|
||||||
// apply any default
|
// apply any default
|
||||||
|
@ -72,21 +72,6 @@ func (t *Timestamp) Get() interface{} {
|
|||||||
return *t
|
return *t
|
||||||
}
|
}
|
||||||
|
|
||||||
// TakesValue returns true of the flag takes a value, otherwise false
|
|
||||||
func (f *TimestampFlag) TakesValue() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetUsage returns the usage string for the flag
|
|
||||||
func (f *TimestampFlag) GetUsage() string {
|
|
||||||
return f.Usage
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetCategory returns the category for the flag
|
|
||||||
func (f *TimestampFlag) GetCategory() string {
|
|
||||||
return f.Category
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetValue returns the flags value as string representation and an empty
|
// GetValue returns the flags value as string representation and an empty
|
||||||
// string if the flag takes no value at all.
|
// string if the flag takes no value at all.
|
||||||
func (f *TimestampFlag) GetValue() string {
|
func (f *TimestampFlag) GetValue() string {
|
||||||
@ -104,11 +89,6 @@ func (f *TimestampFlag) GetDefaultText() string {
|
|||||||
return f.GetValue()
|
return f.GetValue()
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetEnvVars returns the env vars for this flag
|
|
||||||
func (f *TimestampFlag) GetEnvVars() []string {
|
|
||||||
return f.EnvVars
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply populates the flag given the flag set and environment
|
// Apply populates the flag given the flag set and environment
|
||||||
func (f *TimestampFlag) Apply(set *flag.FlagSet) error {
|
func (f *TimestampFlag) Apply(set *flag.FlagSet) error {
|
||||||
if f.Layout == "" {
|
if f.Layout == "" {
|
||||||
|
20
flag_uint.go
20
flag_uint.go
@ -6,21 +6,6 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TakesValue returns true of the flag takes a value, otherwise false
|
|
||||||
func (f *UintFlag) TakesValue() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetUsage returns the usage string for the flag
|
|
||||||
func (f *UintFlag) GetUsage() string {
|
|
||||||
return f.Usage
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetCategory returns the category for the flag
|
|
||||||
func (f *UintFlag) GetCategory() string {
|
|
||||||
return f.Category
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply populates the flag given the flag set and environment
|
// Apply populates the flag given the flag set and environment
|
||||||
func (f *UintFlag) Apply(set *flag.FlagSet) error {
|
func (f *UintFlag) Apply(set *flag.FlagSet) error {
|
||||||
if val, source, found := flagFromEnvOrFile(f.EnvVars, f.FilePath); found {
|
if val, source, found := flagFromEnvOrFile(f.EnvVars, f.FilePath); found {
|
||||||
@ -60,11 +45,6 @@ func (f *UintFlag) GetDefaultText() string {
|
|||||||
return f.GetValue()
|
return f.GetValue()
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetEnvVars returns the env vars for this flag
|
|
||||||
func (f *UintFlag) GetEnvVars() []string {
|
|
||||||
return f.EnvVars
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get returns the flag’s value in the given Context.
|
// Get returns the flag’s value in the given Context.
|
||||||
func (f *UintFlag) Get(ctx *Context) uint {
|
func (f *UintFlag) Get(ctx *Context) uint {
|
||||||
return ctx.Uint(f.Name)
|
return ctx.Uint(f.Name)
|
||||||
|
@ -6,21 +6,6 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TakesValue returns true of the flag takes a value, otherwise false
|
|
||||||
func (f *Uint64Flag) TakesValue() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetUsage returns the usage string for the flag
|
|
||||||
func (f *Uint64Flag) GetUsage() string {
|
|
||||||
return f.Usage
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetCategory returns the category for the flag
|
|
||||||
func (f *Uint64Flag) GetCategory() string {
|
|
||||||
return f.Category
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply populates the flag given the flag set and environment
|
// Apply populates the flag given the flag set and environment
|
||||||
func (f *Uint64Flag) Apply(set *flag.FlagSet) error {
|
func (f *Uint64Flag) Apply(set *flag.FlagSet) error {
|
||||||
if val, source, found := flagFromEnvOrFile(f.EnvVars, f.FilePath); found {
|
if val, source, found := flagFromEnvOrFile(f.EnvVars, f.FilePath); found {
|
||||||
@ -60,11 +45,6 @@ func (f *Uint64Flag) GetDefaultText() string {
|
|||||||
return f.GetValue()
|
return f.GetValue()
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetEnvVars returns the env vars for this flag
|
|
||||||
func (f *Uint64Flag) GetEnvVars() []string {
|
|
||||||
return f.EnvVars
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get returns the flag’s value in the given Context.
|
// Get returns the flag’s value in the given Context.
|
||||||
func (f *Uint64Flag) Get(ctx *Context) uint64 {
|
func (f *Uint64Flag) Get(ctx *Context) uint64 {
|
||||||
return ctx.Uint64(f.Name)
|
return ctx.Uint64(f.Name)
|
||||||
|
@ -64,8 +64,8 @@ GLOBAL OPTIONS:
|
|||||||
COPYRIGHT:
|
COPYRIGHT:
|
||||||
{{wrap .Copyright 3}}{{end}}
|
{{wrap .Copyright 3}}{{end}}
|
||||||
`
|
`
|
||||||
AppHelpTemplate is the text template for the Default help topic. cli.go uses
|
AppHelpTemplate is the text template for the Default help topic. cli.go
|
||||||
text/template to render templates. You can render custom help text by
|
uses text/template to render templates. You can render custom help text by
|
||||||
setting this variable.
|
setting this variable.
|
||||||
|
|
||||||
var CommandHelpTemplate = `NAME:
|
var CommandHelpTemplate = `NAME:
|
||||||
@ -201,9 +201,9 @@ func DefaultAppComplete(cCtx *Context)
|
|||||||
func DefaultCompleteWithFlags(cmd *Command) func(cCtx *Context)
|
func DefaultCompleteWithFlags(cmd *Command) func(cCtx *Context)
|
||||||
func FlagNames(name string, aliases []string) []string
|
func FlagNames(name string, aliases []string) []string
|
||||||
func HandleAction(action interface{}, cCtx *Context) (err error)
|
func HandleAction(action interface{}, cCtx *Context) (err error)
|
||||||
HandleAction attempts to figure out which Action signature was used. If it's
|
HandleAction attempts to figure out which Action signature was used.
|
||||||
an ActionFunc or a func with the legacy signature for Action, the func is
|
If it's an ActionFunc or a func with the legacy signature for Action,
|
||||||
run!
|
the func is run!
|
||||||
|
|
||||||
func HandleExitCoder(err error)
|
func HandleExitCoder(err error)
|
||||||
HandleExitCoder handles errors implementing ExitCoder by printing their
|
HandleExitCoder handles errors implementing ExitCoder by printing their
|
||||||
@ -360,14 +360,14 @@ func (a *App) RunAsSubcommand(ctx *Context) (err error)
|
|||||||
to generate command-specific flags
|
to generate command-specific flags
|
||||||
|
|
||||||
func (a *App) RunContext(ctx context.Context, arguments []string) (err error)
|
func (a *App) RunContext(ctx context.Context, arguments []string) (err error)
|
||||||
RunContext is like Run except it takes a Context that will be passed to its
|
RunContext is like Run except it takes a Context that will be passed to
|
||||||
commands and sub-commands. Through this, you can propagate timeouts and
|
its commands and sub-commands. Through this, you can propagate timeouts and
|
||||||
cancellation requests
|
cancellation requests
|
||||||
|
|
||||||
func (a *App) Setup()
|
func (a *App) Setup()
|
||||||
Setup runs initialization code to ensure all data structures are ready for
|
Setup runs initialization code to ensure all data structures are ready
|
||||||
`Run` or inspection prior to `Run`. It is internally called by `Run`, but
|
for `Run` or inspection prior to `Run`. It is internally called by `Run`,
|
||||||
will return early if setup has already happened.
|
but will return early if setup has already happened.
|
||||||
|
|
||||||
func (a *App) ToFishCompletion() (string, error)
|
func (a *App) ToFishCompletion() (string, error)
|
||||||
ToFishCompletion creates a fish completion string for the `*App` The
|
ToFishCompletion creates a fish completion string for the `*App` The
|
||||||
@ -460,7 +460,7 @@ func (f *BoolFlag) Get(ctx *Context) bool
|
|||||||
Get returns the flag’s value in the given Context.
|
Get returns the flag’s value in the given Context.
|
||||||
|
|
||||||
func (f *BoolFlag) GetCategory() string
|
func (f *BoolFlag) GetCategory() string
|
||||||
GetCategory returns the category for the flag
|
GetCategory returns the category of the flag
|
||||||
|
|
||||||
func (f *BoolFlag) GetDefaultText() string
|
func (f *BoolFlag) GetDefaultText() string
|
||||||
GetDefaultText returns the default text for this flag
|
GetDefaultText returns the default text for this flag
|
||||||
@ -491,12 +491,10 @@ func (f *BoolFlag) String() string
|
|||||||
String returns a readable representation of this value (for usage defaults)
|
String returns a readable representation of this value (for usage defaults)
|
||||||
|
|
||||||
func (f *BoolFlag) TakesValue() bool
|
func (f *BoolFlag) TakesValue() bool
|
||||||
TakesValue returns true of the flag takes a value, otherwise false
|
TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
|
||||||
type CategorizableFlag interface {
|
type CategorizableFlag interface {
|
||||||
VisibleFlag
|
VisibleFlag
|
||||||
|
|
||||||
GetCategory() string
|
|
||||||
}
|
}
|
||||||
CategorizableFlag is an interface that allows us to potentially use a flag
|
CategorizableFlag is an interface that allows us to potentially use a flag
|
||||||
in a categorized representation.
|
in a categorized representation.
|
||||||
@ -707,18 +705,12 @@ type DocGenerationFlag interface {
|
|||||||
// TakesValue returns true if the flag takes a value, otherwise false
|
// TakesValue returns true if the flag takes a value, otherwise false
|
||||||
TakesValue() bool
|
TakesValue() bool
|
||||||
|
|
||||||
// GetUsage returns the usage string for the flag
|
|
||||||
GetUsage() string
|
|
||||||
|
|
||||||
// GetValue returns the flags value as string representation and an empty
|
// GetValue returns the flags value as string representation and an empty
|
||||||
// string if the flag takes no value at all.
|
// string if the flag takes no value at all.
|
||||||
GetValue() string
|
GetValue() string
|
||||||
|
|
||||||
// GetDefaultText returns the default text for this flag
|
// GetDefaultText returns the default text for this flag
|
||||||
GetDefaultText() string
|
GetDefaultText() string
|
||||||
|
|
||||||
// GetEnvVars returns the env vars for this flag
|
|
||||||
GetEnvVars() []string
|
|
||||||
}
|
}
|
||||||
DocGenerationFlag is an interface that allows documentation generation for
|
DocGenerationFlag is an interface that allows documentation generation for
|
||||||
the flag
|
the flag
|
||||||
@ -750,7 +742,7 @@ func (f *DurationFlag) Get(ctx *Context) time.Duration
|
|||||||
Get returns the flag’s value in the given Context.
|
Get returns the flag’s value in the given Context.
|
||||||
|
|
||||||
func (f *DurationFlag) GetCategory() string
|
func (f *DurationFlag) GetCategory() string
|
||||||
GetCategory returns the category for the flag
|
GetCategory returns the category of the flag
|
||||||
|
|
||||||
func (f *DurationFlag) GetDefaultText() string
|
func (f *DurationFlag) GetDefaultText() string
|
||||||
GetDefaultText returns the default text for this flag
|
GetDefaultText returns the default text for this flag
|
||||||
@ -781,7 +773,7 @@ func (f *DurationFlag) String() string
|
|||||||
String returns a readable representation of this value (for usage defaults)
|
String returns a readable representation of this value (for usage defaults)
|
||||||
|
|
||||||
func (f *DurationFlag) TakesValue() bool
|
func (f *DurationFlag) TakesValue() bool
|
||||||
TakesValue returns true of the flag takes a value, otherwise false
|
TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
|
||||||
type ErrorFormatter interface {
|
type ErrorFormatter interface {
|
||||||
Format(s fmt.State, verb rune)
|
Format(s fmt.State, verb rune)
|
||||||
@ -799,9 +791,9 @@ func Exit(message interface{}, exitCode int) ExitCoder
|
|||||||
Exit wraps a message and exit code into an error, which by default is
|
Exit wraps a message and exit code into an error, which by default is
|
||||||
handled with a call to os.Exit during default error handling.
|
handled with a call to os.Exit during default error handling.
|
||||||
|
|
||||||
This is the simplest way to trigger a non-zero exit code for an App without
|
This is the simplest way to trigger a non-zero exit code for an App
|
||||||
having to call os.Exit manually. During testing, this behavior can be
|
without having to call os.Exit manually. During testing, this behavior
|
||||||
avoided by overiding the ExitErrHandler function on an App or the
|
can be avoided by overiding the ExitErrHandler function on an App or the
|
||||||
package-global OsExiter function.
|
package-global OsExiter function.
|
||||||
|
|
||||||
func NewExitError(message interface{}, exitCode int) ExitCoder
|
func NewExitError(message interface{}, exitCode int) ExitCoder
|
||||||
@ -820,6 +812,14 @@ type Flag interface {
|
|||||||
Apply(*flag.FlagSet) error
|
Apply(*flag.FlagSet) error
|
||||||
Names() []string
|
Names() []string
|
||||||
IsSet() bool
|
IsSet() bool
|
||||||
|
IsRequired() bool
|
||||||
|
// IsVisible returns true if the flag is not hidden, otherwise false
|
||||||
|
IsVisible() bool
|
||||||
|
GetCategory() string
|
||||||
|
// GetUsage returns the usage string for the flag
|
||||||
|
GetUsage() string
|
||||||
|
// GetEnvVars returns the env vars for this flag
|
||||||
|
GetEnvVars() []string
|
||||||
}
|
}
|
||||||
Flag is a common interface related to parsing flags in cli. For more
|
Flag is a common interface related to parsing flags in cli. For more
|
||||||
advanced flag parsing techniques, it is recommended that this interface be
|
advanced flag parsing techniques, it is recommended that this interface be
|
||||||
@ -923,7 +923,7 @@ func (f *Float64Flag) Get(ctx *Context) float64
|
|||||||
Get returns the flag’s value in the given Context.
|
Get returns the flag’s value in the given Context.
|
||||||
|
|
||||||
func (f *Float64Flag) GetCategory() string
|
func (f *Float64Flag) GetCategory() string
|
||||||
GetCategory returns the category for the flag
|
GetCategory returns the category of the flag
|
||||||
|
|
||||||
func (f *Float64Flag) GetDefaultText() string
|
func (f *Float64Flag) GetDefaultText() string
|
||||||
GetDefaultText returns the default text for this flag
|
GetDefaultText returns the default text for this flag
|
||||||
@ -954,7 +954,7 @@ func (f *Float64Flag) String() string
|
|||||||
String returns a readable representation of this value (for usage defaults)
|
String returns a readable representation of this value (for usage defaults)
|
||||||
|
|
||||||
func (f *Float64Flag) TakesValue() bool
|
func (f *Float64Flag) TakesValue() bool
|
||||||
TakesValue returns true of the flag takes a value, otherwise false
|
TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
|
||||||
type Float64Slice struct {
|
type Float64Slice struct {
|
||||||
// Has unexported fields.
|
// Has unexported fields.
|
||||||
@ -1006,7 +1006,7 @@ func (f *Float64SliceFlag) Get(ctx *Context) []float64
|
|||||||
Get returns the flag’s value in the given Context.
|
Get returns the flag’s value in the given Context.
|
||||||
|
|
||||||
func (f *Float64SliceFlag) GetCategory() string
|
func (f *Float64SliceFlag) GetCategory() string
|
||||||
GetCategory returns the category for the flag
|
GetCategory returns the category of the flag
|
||||||
|
|
||||||
func (f *Float64SliceFlag) GetDefaultText() string
|
func (f *Float64SliceFlag) GetDefaultText() string
|
||||||
GetDefaultText returns the default text for this flag
|
GetDefaultText returns the default text for this flag
|
||||||
@ -1081,7 +1081,7 @@ func (f *GenericFlag) Get(ctx *Context) interface{}
|
|||||||
Get returns the flag’s value in the given Context.
|
Get returns the flag’s value in the given Context.
|
||||||
|
|
||||||
func (f *GenericFlag) GetCategory() string
|
func (f *GenericFlag) GetCategory() string
|
||||||
GetCategory returns the category for the flag
|
GetCategory returns the category of the flag
|
||||||
|
|
||||||
func (f *GenericFlag) GetDefaultText() string
|
func (f *GenericFlag) GetDefaultText() string
|
||||||
GetDefaultText returns the default text for this flag
|
GetDefaultText returns the default text for this flag
|
||||||
@ -1112,7 +1112,7 @@ func (f *GenericFlag) String() string
|
|||||||
String returns a readable representation of this value (for usage defaults)
|
String returns a readable representation of this value (for usage defaults)
|
||||||
|
|
||||||
func (f *GenericFlag) TakesValue() bool
|
func (f *GenericFlag) TakesValue() bool
|
||||||
TakesValue returns true of the flag takes a value, otherwise false
|
TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
|
||||||
type Int64Flag struct {
|
type Int64Flag struct {
|
||||||
Name string
|
Name string
|
||||||
@ -1141,7 +1141,7 @@ func (f *Int64Flag) Get(ctx *Context) int64
|
|||||||
Get returns the flag’s value in the given Context.
|
Get returns the flag’s value in the given Context.
|
||||||
|
|
||||||
func (f *Int64Flag) GetCategory() string
|
func (f *Int64Flag) GetCategory() string
|
||||||
GetCategory returns the category for the flag
|
GetCategory returns the category of the flag
|
||||||
|
|
||||||
func (f *Int64Flag) GetDefaultText() string
|
func (f *Int64Flag) GetDefaultText() string
|
||||||
GetDefaultText returns the default text for this flag
|
GetDefaultText returns the default text for this flag
|
||||||
@ -1172,7 +1172,7 @@ func (f *Int64Flag) String() string
|
|||||||
String returns a readable representation of this value (for usage defaults)
|
String returns a readable representation of this value (for usage defaults)
|
||||||
|
|
||||||
func (f *Int64Flag) TakesValue() bool
|
func (f *Int64Flag) TakesValue() bool
|
||||||
TakesValue returns true of the flag takes a value, otherwise false
|
TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
|
||||||
type Int64Slice struct {
|
type Int64Slice struct {
|
||||||
// Has unexported fields.
|
// Has unexported fields.
|
||||||
@ -1224,7 +1224,7 @@ func (f *Int64SliceFlag) Get(ctx *Context) []int64
|
|||||||
Get returns the flag’s value in the given Context.
|
Get returns the flag’s value in the given Context.
|
||||||
|
|
||||||
func (f *Int64SliceFlag) GetCategory() string
|
func (f *Int64SliceFlag) GetCategory() string
|
||||||
GetCategory returns the category for the flag
|
GetCategory returns the category of the flag
|
||||||
|
|
||||||
func (f *Int64SliceFlag) GetDefaultText() string
|
func (f *Int64SliceFlag) GetDefaultText() string
|
||||||
GetDefaultText returns the default text for this flag
|
GetDefaultText returns the default text for this flag
|
||||||
@ -1261,7 +1261,7 @@ func (f *Int64SliceFlag) String() string
|
|||||||
String returns a readable representation of this value (for usage defaults)
|
String returns a readable representation of this value (for usage defaults)
|
||||||
|
|
||||||
func (f *Int64SliceFlag) TakesValue() bool
|
func (f *Int64SliceFlag) TakesValue() bool
|
||||||
TakesValue returns true of the flag takes a value, otherwise false
|
TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
|
||||||
type IntFlag struct {
|
type IntFlag struct {
|
||||||
Name string
|
Name string
|
||||||
@ -1290,7 +1290,7 @@ func (f *IntFlag) Get(ctx *Context) int
|
|||||||
Get returns the flag’s value in the given Context.
|
Get returns the flag’s value in the given Context.
|
||||||
|
|
||||||
func (f *IntFlag) GetCategory() string
|
func (f *IntFlag) GetCategory() string
|
||||||
GetCategory returns the category for the flag
|
GetCategory returns the category of the flag
|
||||||
|
|
||||||
func (f *IntFlag) GetDefaultText() string
|
func (f *IntFlag) GetDefaultText() string
|
||||||
GetDefaultText returns the default text for this flag
|
GetDefaultText returns the default text for this flag
|
||||||
@ -1321,7 +1321,7 @@ func (f *IntFlag) String() string
|
|||||||
String returns a readable representation of this value (for usage defaults)
|
String returns a readable representation of this value (for usage defaults)
|
||||||
|
|
||||||
func (f *IntFlag) TakesValue() bool
|
func (f *IntFlag) TakesValue() bool
|
||||||
TakesValue returns true of the flag takes a value, otherwise false
|
TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
|
||||||
type IntSlice struct {
|
type IntSlice struct {
|
||||||
// Has unexported fields.
|
// Has unexported fields.
|
||||||
@ -1377,7 +1377,7 @@ func (f *IntSliceFlag) Get(ctx *Context) []int
|
|||||||
Get returns the flag’s value in the given Context.
|
Get returns the flag’s value in the given Context.
|
||||||
|
|
||||||
func (f *IntSliceFlag) GetCategory() string
|
func (f *IntSliceFlag) GetCategory() string
|
||||||
GetCategory returns the category for the flag
|
GetCategory returns the category of the flag
|
||||||
|
|
||||||
func (f *IntSliceFlag) GetDefaultText() string
|
func (f *IntSliceFlag) GetDefaultText() string
|
||||||
GetDefaultText returns the default text for this flag
|
GetDefaultText returns the default text for this flag
|
||||||
@ -1414,7 +1414,7 @@ func (f *IntSliceFlag) String() string
|
|||||||
String returns a readable representation of this value (for usage defaults)
|
String returns a readable representation of this value (for usage defaults)
|
||||||
|
|
||||||
func (f *IntSliceFlag) TakesValue() bool
|
func (f *IntSliceFlag) TakesValue() bool
|
||||||
TakesValue returns true of the flag takes a value, otherwise false
|
TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
|
||||||
type MultiError interface {
|
type MultiError interface {
|
||||||
error
|
error
|
||||||
@ -1431,8 +1431,8 @@ type MultiInt64Flag = SliceFlag[*Int64SliceFlag, []int64, int64]
|
|||||||
directly, as Value and/or Destination. See also SliceFlag.
|
directly, as Value and/or Destination. See also SliceFlag.
|
||||||
|
|
||||||
type MultiIntFlag = SliceFlag[*IntSliceFlag, []int, int]
|
type MultiIntFlag = SliceFlag[*IntSliceFlag, []int, int]
|
||||||
MultiIntFlag extends IntSliceFlag with support for using slices directly, as
|
MultiIntFlag extends IntSliceFlag with support for using slices directly,
|
||||||
Value and/or Destination. See also SliceFlag.
|
as Value and/or Destination. See also SliceFlag.
|
||||||
|
|
||||||
type MultiStringFlag = SliceFlag[*StringSliceFlag, []string, string]
|
type MultiStringFlag = SliceFlag[*StringSliceFlag, []string, string]
|
||||||
MultiStringFlag extends StringSliceFlag with support for using slices
|
MultiStringFlag extends StringSliceFlag with support for using slices
|
||||||
@ -1475,7 +1475,7 @@ func (f *PathFlag) Get(ctx *Context) string
|
|||||||
Get returns the flag’s value in the given Context.
|
Get returns the flag’s value in the given Context.
|
||||||
|
|
||||||
func (f *PathFlag) GetCategory() string
|
func (f *PathFlag) GetCategory() string
|
||||||
GetCategory returns the category for the flag
|
GetCategory returns the category of the flag
|
||||||
|
|
||||||
func (f *PathFlag) GetDefaultText() string
|
func (f *PathFlag) GetDefaultText() string
|
||||||
GetDefaultText returns the default text for this flag
|
GetDefaultText returns the default text for this flag
|
||||||
@ -1506,15 +1506,13 @@ func (f *PathFlag) String() string
|
|||||||
String returns a readable representation of this value (for usage defaults)
|
String returns a readable representation of this value (for usage defaults)
|
||||||
|
|
||||||
func (f *PathFlag) TakesValue() bool
|
func (f *PathFlag) TakesValue() bool
|
||||||
TakesValue returns true of the flag takes a value, otherwise false
|
TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
|
||||||
type RequiredFlag interface {
|
type RequiredFlag interface {
|
||||||
Flag
|
Flag
|
||||||
|
|
||||||
IsRequired() bool
|
|
||||||
}
|
}
|
||||||
RequiredFlag is an interface that allows us to mark flags as required it
|
RequiredFlag is an interface that allows us to mark flags as required
|
||||||
allows flags required flags to be backwards compatible with the Flag
|
it allows flags required flags to be backwards compatible with the Flag
|
||||||
interface
|
interface
|
||||||
|
|
||||||
type Serializer interface {
|
type Serializer interface {
|
||||||
@ -1527,9 +1525,9 @@ type SliceFlag[T SliceFlagTarget[E], S ~[]E, E any] struct {
|
|||||||
Value S
|
Value S
|
||||||
Destination *S
|
Destination *S
|
||||||
}
|
}
|
||||||
SliceFlag extends implementations like StringSliceFlag and IntSliceFlag with
|
SliceFlag extends implementations like StringSliceFlag and IntSliceFlag
|
||||||
support for using slices directly, as Value and/or Destination. See also
|
with support for using slices directly, as Value and/or Destination.
|
||||||
SliceFlagTarget, MultiStringFlag, MultiFloat64Flag, MultiInt64Flag,
|
See also SliceFlagTarget, MultiStringFlag, MultiFloat64Flag, MultiInt64Flag,
|
||||||
MultiIntFlag.
|
MultiIntFlag.
|
||||||
|
|
||||||
func (x *SliceFlag[T, S, E]) Apply(set *flag.FlagSet) error
|
func (x *SliceFlag[T, S, E]) Apply(set *flag.FlagSet) error
|
||||||
@ -1564,9 +1562,7 @@ func (x *SliceFlag[T, S, E]) TakesValue() bool
|
|||||||
|
|
||||||
type SliceFlagTarget[E any] interface {
|
type SliceFlagTarget[E any] interface {
|
||||||
Flag
|
Flag
|
||||||
RequiredFlag
|
|
||||||
DocGenerationFlag
|
DocGenerationFlag
|
||||||
VisibleFlag
|
|
||||||
CategorizableFlag
|
CategorizableFlag
|
||||||
|
|
||||||
// SetValue should propagate the given slice to the target, ideally as a new value.
|
// SetValue should propagate the given slice to the target, ideally as a new value.
|
||||||
@ -1612,7 +1608,7 @@ func (f *StringFlag) Get(ctx *Context) string
|
|||||||
Get returns the flag’s value in the given Context.
|
Get returns the flag’s value in the given Context.
|
||||||
|
|
||||||
func (f *StringFlag) GetCategory() string
|
func (f *StringFlag) GetCategory() string
|
||||||
GetCategory returns the category for the flag
|
GetCategory returns the category of the flag
|
||||||
|
|
||||||
func (f *StringFlag) GetDefaultText() string
|
func (f *StringFlag) GetDefaultText() string
|
||||||
GetDefaultText returns the default text for this flag
|
GetDefaultText returns the default text for this flag
|
||||||
@ -1643,7 +1639,7 @@ func (f *StringFlag) String() string
|
|||||||
String returns a readable representation of this value (for usage defaults)
|
String returns a readable representation of this value (for usage defaults)
|
||||||
|
|
||||||
func (f *StringFlag) TakesValue() bool
|
func (f *StringFlag) TakesValue() bool
|
||||||
TakesValue returns true of the flag takes a value, otherwise false
|
TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
|
||||||
type StringSlice struct {
|
type StringSlice struct {
|
||||||
// Has unexported fields.
|
// Has unexported fields.
|
||||||
@ -1697,7 +1693,7 @@ func (f *StringSliceFlag) Get(ctx *Context) []string
|
|||||||
Get returns the flag’s value in the given Context.
|
Get returns the flag’s value in the given Context.
|
||||||
|
|
||||||
func (f *StringSliceFlag) GetCategory() string
|
func (f *StringSliceFlag) GetCategory() string
|
||||||
GetCategory returns the category for the flag
|
GetCategory returns the category of the flag
|
||||||
|
|
||||||
func (f *StringSliceFlag) GetDefaultText() string
|
func (f *StringSliceFlag) GetDefaultText() string
|
||||||
GetDefaultText returns the default text for this flag
|
GetDefaultText returns the default text for this flag
|
||||||
@ -1734,7 +1730,7 @@ func (f *StringSliceFlag) String() string
|
|||||||
String returns a readable representation of this value (for usage defaults)
|
String returns a readable representation of this value (for usage defaults)
|
||||||
|
|
||||||
func (f *StringSliceFlag) TakesValue() bool
|
func (f *StringSliceFlag) TakesValue() bool
|
||||||
TakesValue returns true of the flag takes a value, otherwise false
|
TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
|
||||||
type SuggestCommandFunc func(commands []*Command, provided string) string
|
type SuggestCommandFunc func(commands []*Command, provided string) string
|
||||||
|
|
||||||
@ -1800,7 +1796,7 @@ func (f *TimestampFlag) Get(ctx *Context) *time.Time
|
|||||||
Get returns the flag’s value in the given Context.
|
Get returns the flag’s value in the given Context.
|
||||||
|
|
||||||
func (f *TimestampFlag) GetCategory() string
|
func (f *TimestampFlag) GetCategory() string
|
||||||
GetCategory returns the category for the flag
|
GetCategory returns the category of the flag
|
||||||
|
|
||||||
func (f *TimestampFlag) GetDefaultText() string
|
func (f *TimestampFlag) GetDefaultText() string
|
||||||
GetDefaultText returns the default text for this flag
|
GetDefaultText returns the default text for this flag
|
||||||
@ -1831,7 +1827,7 @@ func (f *TimestampFlag) String() string
|
|||||||
String returns a readable representation of this value (for usage defaults)
|
String returns a readable representation of this value (for usage defaults)
|
||||||
|
|
||||||
func (f *TimestampFlag) TakesValue() bool
|
func (f *TimestampFlag) TakesValue() bool
|
||||||
TakesValue returns true of the flag takes a value, otherwise false
|
TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
|
||||||
type Uint64Flag struct {
|
type Uint64Flag struct {
|
||||||
Name string
|
Name string
|
||||||
@ -1860,7 +1856,7 @@ func (f *Uint64Flag) Get(ctx *Context) uint64
|
|||||||
Get returns the flag’s value in the given Context.
|
Get returns the flag’s value in the given Context.
|
||||||
|
|
||||||
func (f *Uint64Flag) GetCategory() string
|
func (f *Uint64Flag) GetCategory() string
|
||||||
GetCategory returns the category for the flag
|
GetCategory returns the category of the flag
|
||||||
|
|
||||||
func (f *Uint64Flag) GetDefaultText() string
|
func (f *Uint64Flag) GetDefaultText() string
|
||||||
GetDefaultText returns the default text for this flag
|
GetDefaultText returns the default text for this flag
|
||||||
@ -1891,7 +1887,7 @@ func (f *Uint64Flag) String() string
|
|||||||
String returns a readable representation of this value (for usage defaults)
|
String returns a readable representation of this value (for usage defaults)
|
||||||
|
|
||||||
func (f *Uint64Flag) TakesValue() bool
|
func (f *Uint64Flag) TakesValue() bool
|
||||||
TakesValue returns true of the flag takes a value, otherwise false
|
TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
|
||||||
type UintFlag struct {
|
type UintFlag struct {
|
||||||
Name string
|
Name string
|
||||||
@ -1920,7 +1916,7 @@ func (f *UintFlag) Get(ctx *Context) uint
|
|||||||
Get returns the flag’s value in the given Context.
|
Get returns the flag’s value in the given Context.
|
||||||
|
|
||||||
func (f *UintFlag) GetCategory() string
|
func (f *UintFlag) GetCategory() string
|
||||||
GetCategory returns the category for the flag
|
GetCategory returns the category of the flag
|
||||||
|
|
||||||
func (f *UintFlag) GetDefaultText() string
|
func (f *UintFlag) GetDefaultText() string
|
||||||
GetDefaultText returns the default text for this flag
|
GetDefaultText returns the default text for this flag
|
||||||
@ -1951,13 +1947,10 @@ func (f *UintFlag) String() string
|
|||||||
String returns a readable representation of this value (for usage defaults)
|
String returns a readable representation of this value (for usage defaults)
|
||||||
|
|
||||||
func (f *UintFlag) TakesValue() bool
|
func (f *UintFlag) TakesValue() bool
|
||||||
TakesValue returns true of the flag takes a value, otherwise false
|
TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
|
||||||
type VisibleFlag interface {
|
type VisibleFlag interface {
|
||||||
Flag
|
Flag
|
||||||
|
|
||||||
// IsVisible returns true if the flag is not hidden, otherwise false
|
|
||||||
IsVisible() bool
|
|
||||||
}
|
}
|
||||||
VisibleFlag is an interface that allows to check if a flag is visible
|
VisibleFlag is an interface that allows to check if a flag is visible
|
||||||
|
|
||||||
@ -1986,9 +1979,9 @@ func InitInputSource(flags []cli.Flag, createInputSource func() (InputSourceCont
|
|||||||
that are supported by the input source
|
that are supported by the input source
|
||||||
|
|
||||||
func InitInputSourceWithContext(flags []cli.Flag, createInputSource func(cCtx *cli.Context) (InputSourceContext, error)) cli.BeforeFunc
|
func InitInputSourceWithContext(flags []cli.Flag, createInputSource func(cCtx *cli.Context) (InputSourceContext, error)) cli.BeforeFunc
|
||||||
InitInputSourceWithContext is used to to setup an InputSourceContext on a
|
InitInputSourceWithContext is used to to setup an InputSourceContext on
|
||||||
cli.Command Before method. It will create a new input source based on the
|
a cli.Command Before method. It will create a new input source based on
|
||||||
func provided with potentially using existing cli.Context values to
|
the func provided with potentially using existing cli.Context values to
|
||||||
initialize itself. If there is no error it will then apply the new input
|
initialize itself. If there is no error it will then apply the new input
|
||||||
source to any flags that are supported by the input source
|
source to any flags that are supported by the input source
|
||||||
|
|
||||||
|
@ -45,21 +45,38 @@ func (f *{{.TypeName}}) Names() []string {
|
|||||||
return {{$.UrfaveCLINamespace}}FlagNames(f.Name, f.Aliases)
|
return {{$.UrfaveCLINamespace}}FlagNames(f.Name, f.Aliases)
|
||||||
}
|
}
|
||||||
|
|
||||||
{{end}}{{/* /if .GenerateFlagInterface */}}
|
|
||||||
|
|
||||||
{{if .GenerateRequiredFlagInterface}}
|
|
||||||
// IsRequired returns whether or not the flag is required
|
// IsRequired returns whether or not the flag is required
|
||||||
func (f *{{.TypeName}}) IsRequired() bool {
|
func (f *{{.TypeName}}) IsRequired() bool {
|
||||||
return f.Required
|
return f.Required
|
||||||
}
|
}
|
||||||
{{end}}{{/* /if .GenerateRequiredFlagInterface */}}
|
|
||||||
|
|
||||||
{{if .GenerateVisibleFlagInterface}}
|
|
||||||
// IsVisible returns true if the flag is not hidden, otherwise false
|
// IsVisible returns true if the flag is not hidden, otherwise false
|
||||||
func (f *{{.TypeName}}) IsVisible() bool {
|
func (f *{{.TypeName}}) IsVisible() bool {
|
||||||
return !f.Hidden
|
return !f.Hidden
|
||||||
}
|
}
|
||||||
{{end}}{{/* /if .GenerateVisibleFlagInterface */}}
|
|
||||||
|
// GetCategory returns the category of the flag
|
||||||
|
func (f *{{.TypeName}}) GetCategory() string {
|
||||||
|
return f.Category
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetUsage returns the usage string for the flag
|
||||||
|
func (f *{{.TypeName}}) GetUsage() string {
|
||||||
|
return f.Usage
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetEnvVars returns the env vars for this flag
|
||||||
|
func (f *{{.TypeName}}) GetEnvVars() []string {
|
||||||
|
return f.EnvVars
|
||||||
|
}
|
||||||
|
|
||||||
|
// TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
func (f *{{.TypeName}}) TakesValue() bool {
|
||||||
|
return "{{.TypeName }}" != "BoolFlag"
|
||||||
|
}
|
||||||
|
|
||||||
|
{{end}}{{/* /if .GenerateFlagInterface */}}
|
||||||
|
|
||||||
{{end}}{{/* /range .SortedFlagTypes */}}
|
{{end}}{{/* /range .SortedFlagTypes */}}
|
||||||
|
|
||||||
// vim{{/* 👻 */}}:ro
|
// vim{{/* 👻 */}}:ro
|
||||||
|
@ -10,6 +10,19 @@ func Test{{.TypeName}}_SatisfiesFlagInterface(t *testing.T) {
|
|||||||
_ = f.IsSet()
|
_ = f.IsSet()
|
||||||
_ = f.Names()
|
_ = f.Names()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Test{{.TypeName}}_SatisfiesRequiredFlagInterface(t *testing.T) {
|
||||||
|
var f {{$.UrfaveCLITestNamespace}}RequiredFlag = &{{$.UrfaveCLITestNamespace}}{{.TypeName}}{}
|
||||||
|
|
||||||
|
_ = f.IsRequired()
|
||||||
|
}
|
||||||
|
|
||||||
|
func Test{{.TypeName}}_SatisfiesVisibleFlagInterface(t *testing.T) {
|
||||||
|
var f {{$.UrfaveCLITestNamespace}}VisibleFlag = &{{$.UrfaveCLITestNamespace}}{{.TypeName}}{}
|
||||||
|
|
||||||
|
_ = f.IsVisible()
|
||||||
|
}
|
||||||
|
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{if .GenerateFmtStringerInterface}}
|
{{if .GenerateFmtStringerInterface}}
|
||||||
@ -20,21 +33,7 @@ func Test{{.TypeName}}_SatisfiesFmtStringerInterface(t *testing.T) {
|
|||||||
}
|
}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{if .GenerateRequiredFlagInterface}}
|
|
||||||
func Test{{.TypeName}}_SatisfiesRequiredFlagInterface(t *testing.T) {
|
|
||||||
var f {{$.UrfaveCLITestNamespace}}RequiredFlag = &{{$.UrfaveCLITestNamespace}}{{.TypeName}}{}
|
|
||||||
|
|
||||||
_ = f.IsRequired()
|
|
||||||
}
|
|
||||||
{{end}}
|
|
||||||
|
|
||||||
{{if .GenerateVisibleFlagInterface}}
|
|
||||||
func Test{{.TypeName}}_SatisfiesVisibleFlagInterface(t *testing.T) {
|
|
||||||
var f {{$.UrfaveCLITestNamespace}}VisibleFlag = &{{$.UrfaveCLITestNamespace}}{{.TypeName}}{}
|
|
||||||
|
|
||||||
_ = f.IsVisible()
|
|
||||||
}
|
|
||||||
{{end}}
|
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
// vim{{/* 👻 */}}:ro
|
// vim{{/* 👻 */}}:ro
|
||||||
|
@ -39,10 +39,11 @@ func (gfs *Spec) SortedFlagTypes() []*FlagType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type FlagTypeConfig struct {
|
type FlagTypeConfig struct {
|
||||||
SkipInterfaces []string `yaml:"skip_interfaces"`
|
SkipInterfaces []string `yaml:"skip_interfaces"`
|
||||||
StructFields []*FlagStructField `yaml:"struct_fields"`
|
StructFields []*FlagStructField `yaml:"struct_fields"`
|
||||||
TypeName string `yaml:"type_name"`
|
TypeName string `yaml:"type_name"`
|
||||||
ValuePointer bool `yaml:"value_pointer"`
|
ValuePointer bool `yaml:"value_pointer"`
|
||||||
|
DoesntNeedValue bool `yaml:"doesnt_need_value"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type FlagStructField struct {
|
type FlagStructField struct {
|
||||||
@ -83,14 +84,6 @@ func (ft *FlagType) GenerateFlagInterface() bool {
|
|||||||
return ft.skipInterfaceNamed("Flag")
|
return ft.skipInterfaceNamed("Flag")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ft *FlagType) GenerateRequiredFlagInterface() bool {
|
|
||||||
return ft.skipInterfaceNamed("RequiredFlag")
|
|
||||||
}
|
|
||||||
|
|
||||||
func (ft *FlagType) GenerateVisibleFlagInterface() bool {
|
|
||||||
return ft.skipInterfaceNamed("VisibleFlag")
|
|
||||||
}
|
|
||||||
|
|
||||||
func (ft *FlagType) skipInterfaceNamed(name string) bool {
|
func (ft *FlagType) skipInterfaceNamed(name string) bool {
|
||||||
if ft.Config == nil {
|
if ft.Config == nil {
|
||||||
return true
|
return true
|
||||||
|
@ -21,9 +21,7 @@ type (
|
|||||||
// update).
|
// update).
|
||||||
SliceFlagTarget[E any] interface {
|
SliceFlagTarget[E any] interface {
|
||||||
Flag
|
Flag
|
||||||
RequiredFlag
|
|
||||||
DocGenerationFlag
|
DocGenerationFlag
|
||||||
VisibleFlag
|
|
||||||
CategorizableFlag
|
CategorizableFlag
|
||||||
|
|
||||||
// SetValue should propagate the given slice to the target, ideally as a new value.
|
// SetValue should propagate the given slice to the target, ideally as a new value.
|
||||||
|
@ -44,6 +44,26 @@ func (f *Float64SliceFlag) IsVisible() bool {
|
|||||||
return !f.Hidden
|
return !f.Hidden
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetCategory returns the category of the flag
|
||||||
|
func (f *Float64SliceFlag) GetCategory() string {
|
||||||
|
return f.Category
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetUsage returns the usage string for the flag
|
||||||
|
func (f *Float64SliceFlag) GetUsage() string {
|
||||||
|
return f.Usage
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetEnvVars returns the env vars for this flag
|
||||||
|
func (f *Float64SliceFlag) GetEnvVars() []string {
|
||||||
|
return f.EnvVars
|
||||||
|
}
|
||||||
|
|
||||||
|
// TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
func (f *Float64SliceFlag) TakesValue() bool {
|
||||||
|
return "Float64SliceFlag" != "BoolFlag"
|
||||||
|
}
|
||||||
|
|
||||||
// GenericFlag is a flag with type Generic
|
// GenericFlag is a flag with type Generic
|
||||||
type GenericFlag struct {
|
type GenericFlag struct {
|
||||||
Name string
|
Name string
|
||||||
@ -91,6 +111,26 @@ func (f *GenericFlag) IsVisible() bool {
|
|||||||
return !f.Hidden
|
return !f.Hidden
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetCategory returns the category of the flag
|
||||||
|
func (f *GenericFlag) GetCategory() string {
|
||||||
|
return f.Category
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetUsage returns the usage string for the flag
|
||||||
|
func (f *GenericFlag) GetUsage() string {
|
||||||
|
return f.Usage
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetEnvVars returns the env vars for this flag
|
||||||
|
func (f *GenericFlag) GetEnvVars() []string {
|
||||||
|
return f.EnvVars
|
||||||
|
}
|
||||||
|
|
||||||
|
// TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
func (f *GenericFlag) TakesValue() bool {
|
||||||
|
return "GenericFlag" != "BoolFlag"
|
||||||
|
}
|
||||||
|
|
||||||
// Int64SliceFlag is a flag with type *Int64Slice
|
// Int64SliceFlag is a flag with type *Int64Slice
|
||||||
type Int64SliceFlag struct {
|
type Int64SliceFlag struct {
|
||||||
Name string
|
Name string
|
||||||
@ -131,6 +171,26 @@ func (f *Int64SliceFlag) IsVisible() bool {
|
|||||||
return !f.Hidden
|
return !f.Hidden
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetCategory returns the category of the flag
|
||||||
|
func (f *Int64SliceFlag) GetCategory() string {
|
||||||
|
return f.Category
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetUsage returns the usage string for the flag
|
||||||
|
func (f *Int64SliceFlag) GetUsage() string {
|
||||||
|
return f.Usage
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetEnvVars returns the env vars for this flag
|
||||||
|
func (f *Int64SliceFlag) GetEnvVars() []string {
|
||||||
|
return f.EnvVars
|
||||||
|
}
|
||||||
|
|
||||||
|
// TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
func (f *Int64SliceFlag) TakesValue() bool {
|
||||||
|
return "Int64SliceFlag" != "BoolFlag"
|
||||||
|
}
|
||||||
|
|
||||||
// IntSliceFlag is a flag with type *IntSlice
|
// IntSliceFlag is a flag with type *IntSlice
|
||||||
type IntSliceFlag struct {
|
type IntSliceFlag struct {
|
||||||
Name string
|
Name string
|
||||||
@ -171,6 +231,26 @@ func (f *IntSliceFlag) IsVisible() bool {
|
|||||||
return !f.Hidden
|
return !f.Hidden
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetCategory returns the category of the flag
|
||||||
|
func (f *IntSliceFlag) GetCategory() string {
|
||||||
|
return f.Category
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetUsage returns the usage string for the flag
|
||||||
|
func (f *IntSliceFlag) GetUsage() string {
|
||||||
|
return f.Usage
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetEnvVars returns the env vars for this flag
|
||||||
|
func (f *IntSliceFlag) GetEnvVars() []string {
|
||||||
|
return f.EnvVars
|
||||||
|
}
|
||||||
|
|
||||||
|
// TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
func (f *IntSliceFlag) TakesValue() bool {
|
||||||
|
return "IntSliceFlag" != "BoolFlag"
|
||||||
|
}
|
||||||
|
|
||||||
// PathFlag is a flag with type Path
|
// PathFlag is a flag with type Path
|
||||||
type PathFlag struct {
|
type PathFlag struct {
|
||||||
Name string
|
Name string
|
||||||
@ -218,6 +298,26 @@ func (f *PathFlag) IsVisible() bool {
|
|||||||
return !f.Hidden
|
return !f.Hidden
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetCategory returns the category of the flag
|
||||||
|
func (f *PathFlag) GetCategory() string {
|
||||||
|
return f.Category
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetUsage returns the usage string for the flag
|
||||||
|
func (f *PathFlag) GetUsage() string {
|
||||||
|
return f.Usage
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetEnvVars returns the env vars for this flag
|
||||||
|
func (f *PathFlag) GetEnvVars() []string {
|
||||||
|
return f.EnvVars
|
||||||
|
}
|
||||||
|
|
||||||
|
// TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
func (f *PathFlag) TakesValue() bool {
|
||||||
|
return "PathFlag" != "BoolFlag"
|
||||||
|
}
|
||||||
|
|
||||||
// StringSliceFlag is a flag with type *StringSlice
|
// StringSliceFlag is a flag with type *StringSlice
|
||||||
type StringSliceFlag struct {
|
type StringSliceFlag struct {
|
||||||
Name string
|
Name string
|
||||||
@ -260,6 +360,26 @@ func (f *StringSliceFlag) IsVisible() bool {
|
|||||||
return !f.Hidden
|
return !f.Hidden
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetCategory returns the category of the flag
|
||||||
|
func (f *StringSliceFlag) GetCategory() string {
|
||||||
|
return f.Category
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetUsage returns the usage string for the flag
|
||||||
|
func (f *StringSliceFlag) GetUsage() string {
|
||||||
|
return f.Usage
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetEnvVars returns the env vars for this flag
|
||||||
|
func (f *StringSliceFlag) GetEnvVars() []string {
|
||||||
|
return f.EnvVars
|
||||||
|
}
|
||||||
|
|
||||||
|
// TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
func (f *StringSliceFlag) TakesValue() bool {
|
||||||
|
return "StringSliceFlag" != "BoolFlag"
|
||||||
|
}
|
||||||
|
|
||||||
// TimestampFlag is a flag with type *Timestamp
|
// TimestampFlag is a flag with type *Timestamp
|
||||||
type TimestampFlag struct {
|
type TimestampFlag struct {
|
||||||
Name string
|
Name string
|
||||||
@ -309,6 +429,26 @@ func (f *TimestampFlag) IsVisible() bool {
|
|||||||
return !f.Hidden
|
return !f.Hidden
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetCategory returns the category of the flag
|
||||||
|
func (f *TimestampFlag) GetCategory() string {
|
||||||
|
return f.Category
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetUsage returns the usage string for the flag
|
||||||
|
func (f *TimestampFlag) GetUsage() string {
|
||||||
|
return f.Usage
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetEnvVars returns the env vars for this flag
|
||||||
|
func (f *TimestampFlag) GetEnvVars() []string {
|
||||||
|
return f.EnvVars
|
||||||
|
}
|
||||||
|
|
||||||
|
// TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
func (f *TimestampFlag) TakesValue() bool {
|
||||||
|
return "TimestampFlag" != "BoolFlag"
|
||||||
|
}
|
||||||
|
|
||||||
// BoolFlag is a flag with type bool
|
// BoolFlag is a flag with type bool
|
||||||
type BoolFlag struct {
|
type BoolFlag struct {
|
||||||
Name string
|
Name string
|
||||||
@ -354,6 +494,26 @@ func (f *BoolFlag) IsVisible() bool {
|
|||||||
return !f.Hidden
|
return !f.Hidden
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetCategory returns the category of the flag
|
||||||
|
func (f *BoolFlag) GetCategory() string {
|
||||||
|
return f.Category
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetUsage returns the usage string for the flag
|
||||||
|
func (f *BoolFlag) GetUsage() string {
|
||||||
|
return f.Usage
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetEnvVars returns the env vars for this flag
|
||||||
|
func (f *BoolFlag) GetEnvVars() []string {
|
||||||
|
return f.EnvVars
|
||||||
|
}
|
||||||
|
|
||||||
|
// TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
func (f *BoolFlag) TakesValue() bool {
|
||||||
|
return "BoolFlag" != "BoolFlag"
|
||||||
|
}
|
||||||
|
|
||||||
// Float64Flag is a flag with type float64
|
// Float64Flag is a flag with type float64
|
||||||
type Float64Flag struct {
|
type Float64Flag struct {
|
||||||
Name string
|
Name string
|
||||||
@ -399,6 +559,26 @@ func (f *Float64Flag) IsVisible() bool {
|
|||||||
return !f.Hidden
|
return !f.Hidden
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetCategory returns the category of the flag
|
||||||
|
func (f *Float64Flag) GetCategory() string {
|
||||||
|
return f.Category
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetUsage returns the usage string for the flag
|
||||||
|
func (f *Float64Flag) GetUsage() string {
|
||||||
|
return f.Usage
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetEnvVars returns the env vars for this flag
|
||||||
|
func (f *Float64Flag) GetEnvVars() []string {
|
||||||
|
return f.EnvVars
|
||||||
|
}
|
||||||
|
|
||||||
|
// TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
func (f *Float64Flag) TakesValue() bool {
|
||||||
|
return "Float64Flag" != "BoolFlag"
|
||||||
|
}
|
||||||
|
|
||||||
// IntFlag is a flag with type int
|
// IntFlag is a flag with type int
|
||||||
type IntFlag struct {
|
type IntFlag struct {
|
||||||
Name string
|
Name string
|
||||||
@ -444,6 +624,26 @@ func (f *IntFlag) IsVisible() bool {
|
|||||||
return !f.Hidden
|
return !f.Hidden
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetCategory returns the category of the flag
|
||||||
|
func (f *IntFlag) GetCategory() string {
|
||||||
|
return f.Category
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetUsage returns the usage string for the flag
|
||||||
|
func (f *IntFlag) GetUsage() string {
|
||||||
|
return f.Usage
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetEnvVars returns the env vars for this flag
|
||||||
|
func (f *IntFlag) GetEnvVars() []string {
|
||||||
|
return f.EnvVars
|
||||||
|
}
|
||||||
|
|
||||||
|
// TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
func (f *IntFlag) TakesValue() bool {
|
||||||
|
return "IntFlag" != "BoolFlag"
|
||||||
|
}
|
||||||
|
|
||||||
// Int64Flag is a flag with type int64
|
// Int64Flag is a flag with type int64
|
||||||
type Int64Flag struct {
|
type Int64Flag struct {
|
||||||
Name string
|
Name string
|
||||||
@ -489,6 +689,26 @@ func (f *Int64Flag) IsVisible() bool {
|
|||||||
return !f.Hidden
|
return !f.Hidden
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetCategory returns the category of the flag
|
||||||
|
func (f *Int64Flag) GetCategory() string {
|
||||||
|
return f.Category
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetUsage returns the usage string for the flag
|
||||||
|
func (f *Int64Flag) GetUsage() string {
|
||||||
|
return f.Usage
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetEnvVars returns the env vars for this flag
|
||||||
|
func (f *Int64Flag) GetEnvVars() []string {
|
||||||
|
return f.EnvVars
|
||||||
|
}
|
||||||
|
|
||||||
|
// TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
func (f *Int64Flag) TakesValue() bool {
|
||||||
|
return "Int64Flag" != "BoolFlag"
|
||||||
|
}
|
||||||
|
|
||||||
// StringFlag is a flag with type string
|
// StringFlag is a flag with type string
|
||||||
type StringFlag struct {
|
type StringFlag struct {
|
||||||
Name string
|
Name string
|
||||||
@ -536,6 +756,26 @@ func (f *StringFlag) IsVisible() bool {
|
|||||||
return !f.Hidden
|
return !f.Hidden
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetCategory returns the category of the flag
|
||||||
|
func (f *StringFlag) GetCategory() string {
|
||||||
|
return f.Category
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetUsage returns the usage string for the flag
|
||||||
|
func (f *StringFlag) GetUsage() string {
|
||||||
|
return f.Usage
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetEnvVars returns the env vars for this flag
|
||||||
|
func (f *StringFlag) GetEnvVars() []string {
|
||||||
|
return f.EnvVars
|
||||||
|
}
|
||||||
|
|
||||||
|
// TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
func (f *StringFlag) TakesValue() bool {
|
||||||
|
return "StringFlag" != "BoolFlag"
|
||||||
|
}
|
||||||
|
|
||||||
// DurationFlag is a flag with type time.Duration
|
// DurationFlag is a flag with type time.Duration
|
||||||
type DurationFlag struct {
|
type DurationFlag struct {
|
||||||
Name string
|
Name string
|
||||||
@ -581,6 +821,26 @@ func (f *DurationFlag) IsVisible() bool {
|
|||||||
return !f.Hidden
|
return !f.Hidden
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetCategory returns the category of the flag
|
||||||
|
func (f *DurationFlag) GetCategory() string {
|
||||||
|
return f.Category
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetUsage returns the usage string for the flag
|
||||||
|
func (f *DurationFlag) GetUsage() string {
|
||||||
|
return f.Usage
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetEnvVars returns the env vars for this flag
|
||||||
|
func (f *DurationFlag) GetEnvVars() []string {
|
||||||
|
return f.EnvVars
|
||||||
|
}
|
||||||
|
|
||||||
|
// TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
func (f *DurationFlag) TakesValue() bool {
|
||||||
|
return "DurationFlag" != "BoolFlag"
|
||||||
|
}
|
||||||
|
|
||||||
// UintFlag is a flag with type uint
|
// UintFlag is a flag with type uint
|
||||||
type UintFlag struct {
|
type UintFlag struct {
|
||||||
Name string
|
Name string
|
||||||
@ -626,6 +886,26 @@ func (f *UintFlag) IsVisible() bool {
|
|||||||
return !f.Hidden
|
return !f.Hidden
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetCategory returns the category of the flag
|
||||||
|
func (f *UintFlag) GetCategory() string {
|
||||||
|
return f.Category
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetUsage returns the usage string for the flag
|
||||||
|
func (f *UintFlag) GetUsage() string {
|
||||||
|
return f.Usage
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetEnvVars returns the env vars for this flag
|
||||||
|
func (f *UintFlag) GetEnvVars() []string {
|
||||||
|
return f.EnvVars
|
||||||
|
}
|
||||||
|
|
||||||
|
// TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
func (f *UintFlag) TakesValue() bool {
|
||||||
|
return "UintFlag" != "BoolFlag"
|
||||||
|
}
|
||||||
|
|
||||||
// Uint64Flag is a flag with type uint64
|
// Uint64Flag is a flag with type uint64
|
||||||
type Uint64Flag struct {
|
type Uint64Flag struct {
|
||||||
Name string
|
Name string
|
||||||
@ -671,4 +951,24 @@ func (f *Uint64Flag) IsVisible() bool {
|
|||||||
return !f.Hidden
|
return !f.Hidden
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetCategory returns the category of the flag
|
||||||
|
func (f *Uint64Flag) GetCategory() string {
|
||||||
|
return f.Category
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetUsage returns the usage string for the flag
|
||||||
|
func (f *Uint64Flag) GetUsage() string {
|
||||||
|
return f.Usage
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetEnvVars returns the env vars for this flag
|
||||||
|
func (f *Uint64Flag) GetEnvVars() []string {
|
||||||
|
return f.EnvVars
|
||||||
|
}
|
||||||
|
|
||||||
|
// TakesValue returns true if the flag takes a value, otherwise false
|
||||||
|
func (f *Uint64Flag) TakesValue() bool {
|
||||||
|
return "Uint64Flag" != "BoolFlag"
|
||||||
|
}
|
||||||
|
|
||||||
// vim:ro
|
// vim:ro
|
||||||
|
@ -35,12 +35,6 @@ func TestGenericFlag_SatisfiesFlagInterface(t *testing.T) {
|
|||||||
_ = f.Names()
|
_ = f.Names()
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestGenericFlag_SatisfiesFmtStringerInterface(t *testing.T) {
|
|
||||||
var f fmt.Stringer = &cli.GenericFlag{}
|
|
||||||
|
|
||||||
_ = f.String()
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestGenericFlag_SatisfiesRequiredFlagInterface(t *testing.T) {
|
func TestGenericFlag_SatisfiesRequiredFlagInterface(t *testing.T) {
|
||||||
var f cli.RequiredFlag = &cli.GenericFlag{}
|
var f cli.RequiredFlag = &cli.GenericFlag{}
|
||||||
|
|
||||||
@ -53,6 +47,12 @@ func TestGenericFlag_SatisfiesVisibleFlagInterface(t *testing.T) {
|
|||||||
_ = f.IsVisible()
|
_ = f.IsVisible()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestGenericFlag_SatisfiesFmtStringerInterface(t *testing.T) {
|
||||||
|
var f fmt.Stringer = &cli.GenericFlag{}
|
||||||
|
|
||||||
|
_ = f.String()
|
||||||
|
}
|
||||||
|
|
||||||
func TestInt64SliceFlag_SatisfiesFlagInterface(t *testing.T) {
|
func TestInt64SliceFlag_SatisfiesFlagInterface(t *testing.T) {
|
||||||
var f cli.Flag = &cli.Int64SliceFlag{}
|
var f cli.Flag = &cli.Int64SliceFlag{}
|
||||||
|
|
||||||
@ -98,12 +98,6 @@ func TestPathFlag_SatisfiesFlagInterface(t *testing.T) {
|
|||||||
_ = f.Names()
|
_ = f.Names()
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPathFlag_SatisfiesFmtStringerInterface(t *testing.T) {
|
|
||||||
var f fmt.Stringer = &cli.PathFlag{}
|
|
||||||
|
|
||||||
_ = f.String()
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestPathFlag_SatisfiesRequiredFlagInterface(t *testing.T) {
|
func TestPathFlag_SatisfiesRequiredFlagInterface(t *testing.T) {
|
||||||
var f cli.RequiredFlag = &cli.PathFlag{}
|
var f cli.RequiredFlag = &cli.PathFlag{}
|
||||||
|
|
||||||
@ -116,6 +110,12 @@ func TestPathFlag_SatisfiesVisibleFlagInterface(t *testing.T) {
|
|||||||
_ = f.IsVisible()
|
_ = f.IsVisible()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestPathFlag_SatisfiesFmtStringerInterface(t *testing.T) {
|
||||||
|
var f fmt.Stringer = &cli.PathFlag{}
|
||||||
|
|
||||||
|
_ = f.String()
|
||||||
|
}
|
||||||
|
|
||||||
func TestStringSliceFlag_SatisfiesFlagInterface(t *testing.T) {
|
func TestStringSliceFlag_SatisfiesFlagInterface(t *testing.T) {
|
||||||
var f cli.Flag = &cli.StringSliceFlag{}
|
var f cli.Flag = &cli.StringSliceFlag{}
|
||||||
|
|
||||||
@ -142,12 +142,6 @@ func TestTimestampFlag_SatisfiesFlagInterface(t *testing.T) {
|
|||||||
_ = f.Names()
|
_ = f.Names()
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestTimestampFlag_SatisfiesFmtStringerInterface(t *testing.T) {
|
|
||||||
var f fmt.Stringer = &cli.TimestampFlag{}
|
|
||||||
|
|
||||||
_ = f.String()
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestTimestampFlag_SatisfiesRequiredFlagInterface(t *testing.T) {
|
func TestTimestampFlag_SatisfiesRequiredFlagInterface(t *testing.T) {
|
||||||
var f cli.RequiredFlag = &cli.TimestampFlag{}
|
var f cli.RequiredFlag = &cli.TimestampFlag{}
|
||||||
|
|
||||||
@ -160,6 +154,12 @@ func TestTimestampFlag_SatisfiesVisibleFlagInterface(t *testing.T) {
|
|||||||
_ = f.IsVisible()
|
_ = f.IsVisible()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestTimestampFlag_SatisfiesFmtStringerInterface(t *testing.T) {
|
||||||
|
var f fmt.Stringer = &cli.TimestampFlag{}
|
||||||
|
|
||||||
|
_ = f.String()
|
||||||
|
}
|
||||||
|
|
||||||
func TestBoolFlag_SatisfiesFlagInterface(t *testing.T) {
|
func TestBoolFlag_SatisfiesFlagInterface(t *testing.T) {
|
||||||
var f cli.Flag = &cli.BoolFlag{}
|
var f cli.Flag = &cli.BoolFlag{}
|
||||||
|
|
||||||
@ -167,12 +167,6 @@ func TestBoolFlag_SatisfiesFlagInterface(t *testing.T) {
|
|||||||
_ = f.Names()
|
_ = f.Names()
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestBoolFlag_SatisfiesFmtStringerInterface(t *testing.T) {
|
|
||||||
var f fmt.Stringer = &cli.BoolFlag{}
|
|
||||||
|
|
||||||
_ = f.String()
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestBoolFlag_SatisfiesRequiredFlagInterface(t *testing.T) {
|
func TestBoolFlag_SatisfiesRequiredFlagInterface(t *testing.T) {
|
||||||
var f cli.RequiredFlag = &cli.BoolFlag{}
|
var f cli.RequiredFlag = &cli.BoolFlag{}
|
||||||
|
|
||||||
@ -185,6 +179,12 @@ func TestBoolFlag_SatisfiesVisibleFlagInterface(t *testing.T) {
|
|||||||
_ = f.IsVisible()
|
_ = f.IsVisible()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestBoolFlag_SatisfiesFmtStringerInterface(t *testing.T) {
|
||||||
|
var f fmt.Stringer = &cli.BoolFlag{}
|
||||||
|
|
||||||
|
_ = f.String()
|
||||||
|
}
|
||||||
|
|
||||||
func TestFloat64Flag_SatisfiesFlagInterface(t *testing.T) {
|
func TestFloat64Flag_SatisfiesFlagInterface(t *testing.T) {
|
||||||
var f cli.Flag = &cli.Float64Flag{}
|
var f cli.Flag = &cli.Float64Flag{}
|
||||||
|
|
||||||
@ -192,12 +192,6 @@ func TestFloat64Flag_SatisfiesFlagInterface(t *testing.T) {
|
|||||||
_ = f.Names()
|
_ = f.Names()
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestFloat64Flag_SatisfiesFmtStringerInterface(t *testing.T) {
|
|
||||||
var f fmt.Stringer = &cli.Float64Flag{}
|
|
||||||
|
|
||||||
_ = f.String()
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestFloat64Flag_SatisfiesRequiredFlagInterface(t *testing.T) {
|
func TestFloat64Flag_SatisfiesRequiredFlagInterface(t *testing.T) {
|
||||||
var f cli.RequiredFlag = &cli.Float64Flag{}
|
var f cli.RequiredFlag = &cli.Float64Flag{}
|
||||||
|
|
||||||
@ -210,6 +204,12 @@ func TestFloat64Flag_SatisfiesVisibleFlagInterface(t *testing.T) {
|
|||||||
_ = f.IsVisible()
|
_ = f.IsVisible()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestFloat64Flag_SatisfiesFmtStringerInterface(t *testing.T) {
|
||||||
|
var f fmt.Stringer = &cli.Float64Flag{}
|
||||||
|
|
||||||
|
_ = f.String()
|
||||||
|
}
|
||||||
|
|
||||||
func TestIntFlag_SatisfiesFlagInterface(t *testing.T) {
|
func TestIntFlag_SatisfiesFlagInterface(t *testing.T) {
|
||||||
var f cli.Flag = &cli.IntFlag{}
|
var f cli.Flag = &cli.IntFlag{}
|
||||||
|
|
||||||
@ -217,12 +217,6 @@ func TestIntFlag_SatisfiesFlagInterface(t *testing.T) {
|
|||||||
_ = f.Names()
|
_ = f.Names()
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestIntFlag_SatisfiesFmtStringerInterface(t *testing.T) {
|
|
||||||
var f fmt.Stringer = &cli.IntFlag{}
|
|
||||||
|
|
||||||
_ = f.String()
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestIntFlag_SatisfiesRequiredFlagInterface(t *testing.T) {
|
func TestIntFlag_SatisfiesRequiredFlagInterface(t *testing.T) {
|
||||||
var f cli.RequiredFlag = &cli.IntFlag{}
|
var f cli.RequiredFlag = &cli.IntFlag{}
|
||||||
|
|
||||||
@ -235,6 +229,12 @@ func TestIntFlag_SatisfiesVisibleFlagInterface(t *testing.T) {
|
|||||||
_ = f.IsVisible()
|
_ = f.IsVisible()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestIntFlag_SatisfiesFmtStringerInterface(t *testing.T) {
|
||||||
|
var f fmt.Stringer = &cli.IntFlag{}
|
||||||
|
|
||||||
|
_ = f.String()
|
||||||
|
}
|
||||||
|
|
||||||
func TestInt64Flag_SatisfiesFlagInterface(t *testing.T) {
|
func TestInt64Flag_SatisfiesFlagInterface(t *testing.T) {
|
||||||
var f cli.Flag = &cli.Int64Flag{}
|
var f cli.Flag = &cli.Int64Flag{}
|
||||||
|
|
||||||
@ -242,12 +242,6 @@ func TestInt64Flag_SatisfiesFlagInterface(t *testing.T) {
|
|||||||
_ = f.Names()
|
_ = f.Names()
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestInt64Flag_SatisfiesFmtStringerInterface(t *testing.T) {
|
|
||||||
var f fmt.Stringer = &cli.Int64Flag{}
|
|
||||||
|
|
||||||
_ = f.String()
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestInt64Flag_SatisfiesRequiredFlagInterface(t *testing.T) {
|
func TestInt64Flag_SatisfiesRequiredFlagInterface(t *testing.T) {
|
||||||
var f cli.RequiredFlag = &cli.Int64Flag{}
|
var f cli.RequiredFlag = &cli.Int64Flag{}
|
||||||
|
|
||||||
@ -260,6 +254,12 @@ func TestInt64Flag_SatisfiesVisibleFlagInterface(t *testing.T) {
|
|||||||
_ = f.IsVisible()
|
_ = f.IsVisible()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestInt64Flag_SatisfiesFmtStringerInterface(t *testing.T) {
|
||||||
|
var f fmt.Stringer = &cli.Int64Flag{}
|
||||||
|
|
||||||
|
_ = f.String()
|
||||||
|
}
|
||||||
|
|
||||||
func TestStringFlag_SatisfiesFlagInterface(t *testing.T) {
|
func TestStringFlag_SatisfiesFlagInterface(t *testing.T) {
|
||||||
var f cli.Flag = &cli.StringFlag{}
|
var f cli.Flag = &cli.StringFlag{}
|
||||||
|
|
||||||
@ -267,12 +267,6 @@ func TestStringFlag_SatisfiesFlagInterface(t *testing.T) {
|
|||||||
_ = f.Names()
|
_ = f.Names()
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestStringFlag_SatisfiesFmtStringerInterface(t *testing.T) {
|
|
||||||
var f fmt.Stringer = &cli.StringFlag{}
|
|
||||||
|
|
||||||
_ = f.String()
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestStringFlag_SatisfiesRequiredFlagInterface(t *testing.T) {
|
func TestStringFlag_SatisfiesRequiredFlagInterface(t *testing.T) {
|
||||||
var f cli.RequiredFlag = &cli.StringFlag{}
|
var f cli.RequiredFlag = &cli.StringFlag{}
|
||||||
|
|
||||||
@ -285,6 +279,12 @@ func TestStringFlag_SatisfiesVisibleFlagInterface(t *testing.T) {
|
|||||||
_ = f.IsVisible()
|
_ = f.IsVisible()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestStringFlag_SatisfiesFmtStringerInterface(t *testing.T) {
|
||||||
|
var f fmt.Stringer = &cli.StringFlag{}
|
||||||
|
|
||||||
|
_ = f.String()
|
||||||
|
}
|
||||||
|
|
||||||
func TestDurationFlag_SatisfiesFlagInterface(t *testing.T) {
|
func TestDurationFlag_SatisfiesFlagInterface(t *testing.T) {
|
||||||
var f cli.Flag = &cli.DurationFlag{}
|
var f cli.Flag = &cli.DurationFlag{}
|
||||||
|
|
||||||
@ -292,12 +292,6 @@ func TestDurationFlag_SatisfiesFlagInterface(t *testing.T) {
|
|||||||
_ = f.Names()
|
_ = f.Names()
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDurationFlag_SatisfiesFmtStringerInterface(t *testing.T) {
|
|
||||||
var f fmt.Stringer = &cli.DurationFlag{}
|
|
||||||
|
|
||||||
_ = f.String()
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestDurationFlag_SatisfiesRequiredFlagInterface(t *testing.T) {
|
func TestDurationFlag_SatisfiesRequiredFlagInterface(t *testing.T) {
|
||||||
var f cli.RequiredFlag = &cli.DurationFlag{}
|
var f cli.RequiredFlag = &cli.DurationFlag{}
|
||||||
|
|
||||||
@ -310,6 +304,12 @@ func TestDurationFlag_SatisfiesVisibleFlagInterface(t *testing.T) {
|
|||||||
_ = f.IsVisible()
|
_ = f.IsVisible()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestDurationFlag_SatisfiesFmtStringerInterface(t *testing.T) {
|
||||||
|
var f fmt.Stringer = &cli.DurationFlag{}
|
||||||
|
|
||||||
|
_ = f.String()
|
||||||
|
}
|
||||||
|
|
||||||
func TestUintFlag_SatisfiesFlagInterface(t *testing.T) {
|
func TestUintFlag_SatisfiesFlagInterface(t *testing.T) {
|
||||||
var f cli.Flag = &cli.UintFlag{}
|
var f cli.Flag = &cli.UintFlag{}
|
||||||
|
|
||||||
@ -317,12 +317,6 @@ func TestUintFlag_SatisfiesFlagInterface(t *testing.T) {
|
|||||||
_ = f.Names()
|
_ = f.Names()
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestUintFlag_SatisfiesFmtStringerInterface(t *testing.T) {
|
|
||||||
var f fmt.Stringer = &cli.UintFlag{}
|
|
||||||
|
|
||||||
_ = f.String()
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestUintFlag_SatisfiesRequiredFlagInterface(t *testing.T) {
|
func TestUintFlag_SatisfiesRequiredFlagInterface(t *testing.T) {
|
||||||
var f cli.RequiredFlag = &cli.UintFlag{}
|
var f cli.RequiredFlag = &cli.UintFlag{}
|
||||||
|
|
||||||
@ -335,6 +329,12 @@ func TestUintFlag_SatisfiesVisibleFlagInterface(t *testing.T) {
|
|||||||
_ = f.IsVisible()
|
_ = f.IsVisible()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestUintFlag_SatisfiesFmtStringerInterface(t *testing.T) {
|
||||||
|
var f fmt.Stringer = &cli.UintFlag{}
|
||||||
|
|
||||||
|
_ = f.String()
|
||||||
|
}
|
||||||
|
|
||||||
func TestUint64Flag_SatisfiesFlagInterface(t *testing.T) {
|
func TestUint64Flag_SatisfiesFlagInterface(t *testing.T) {
|
||||||
var f cli.Flag = &cli.Uint64Flag{}
|
var f cli.Flag = &cli.Uint64Flag{}
|
||||||
|
|
||||||
@ -342,12 +342,6 @@ func TestUint64Flag_SatisfiesFlagInterface(t *testing.T) {
|
|||||||
_ = f.Names()
|
_ = f.Names()
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestUint64Flag_SatisfiesFmtStringerInterface(t *testing.T) {
|
|
||||||
var f fmt.Stringer = &cli.Uint64Flag{}
|
|
||||||
|
|
||||||
_ = f.String()
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestUint64Flag_SatisfiesRequiredFlagInterface(t *testing.T) {
|
func TestUint64Flag_SatisfiesRequiredFlagInterface(t *testing.T) {
|
||||||
var f cli.RequiredFlag = &cli.Uint64Flag{}
|
var f cli.RequiredFlag = &cli.Uint64Flag{}
|
||||||
|
|
||||||
@ -360,4 +354,10 @@ func TestUint64Flag_SatisfiesVisibleFlagInterface(t *testing.T) {
|
|||||||
_ = f.IsVisible()
|
_ = f.IsVisible()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestUint64Flag_SatisfiesFmtStringerInterface(t *testing.T) {
|
||||||
|
var f fmt.Stringer = &cli.Uint64Flag{}
|
||||||
|
|
||||||
|
_ = f.String()
|
||||||
|
}
|
||||||
|
|
||||||
// vim:ro
|
// vim:ro
|
||||||
|
Loading…
x
Reference in New Issue
Block a user