Cleanup: Collapse flag interfaces

This commit is contained in:
Naveen Gogineni
2022-09-04 22:18:41 -04:00
parent 321610437e
commit ab68d8a69d
24 changed files with 491 additions and 480 deletions

View File

@@ -5,21 +5,6 @@ import (
"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
// string if the flag takes no value at all.
func (f *StringFlag) GetValue() string {
@@ -37,11 +22,6 @@ func (f *StringFlag) GetDefaultText() string {
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
func (f *StringFlag) Apply(set *flag.FlagSet) error {
if val, _, found := flagFromEnvOrFile(f.EnvVars, f.FilePath); found {