backwards compatible RequiredFlag implementation
This commit is contained in:
9
flag.go
9
flag.go
@@ -72,10 +72,17 @@ type Flag interface {
|
||||
fmt.Stringer
|
||||
// Apply Flag settings to the given flag set
|
||||
Apply(*flag.FlagSet)
|
||||
IsRequired() bool
|
||||
GetName() string
|
||||
}
|
||||
|
||||
// RequiredFlag is an interface that allows us to return mark flags as required
|
||||
// it allows flags defined in this library to be marked as required in a backwards compatible fashion
|
||||
type RequiredFlag interface {
|
||||
Flag
|
||||
|
||||
IsRequired() bool
|
||||
}
|
||||
|
||||
// errorableFlag is an interface that allows us to return errors during apply
|
||||
// it allows flags defined in this library to return errors in a fashion backwards compatible
|
||||
// TODO remove in v2 and modify the existing Flag interface to return errors
|
||||
|
Reference in New Issue
Block a user