Generate RequiredFlag and VisibleFlag implementations

This commit is contained in:
2022-05-08 13:52:32 -04:00
parent c6f7393473
commit bc9ad9fede
20 changed files with 369 additions and 151 deletions

View File

@@ -5,11 +5,6 @@ import (
"fmt"
)
// IsRequired returns whether or not the flag is required
func (f *StringFlag) IsRequired() bool {
return f.Required
}
// TakesValue returns true of the flag takes a value, otherwise false
func (f *StringFlag) TakesValue() bool {
return true
@@ -26,11 +21,6 @@ func (f *StringFlag) GetValue() string {
return f.Value
}
// IsVisible returns true if the flag is not hidden, otherwise false
func (f *StringFlag) IsVisible() bool {
return !f.Hidden
}
// GetDefaultText returns the default text for this flag
func (f *StringFlag) GetDefaultText() string {
if f.DefaultText != "" {