|
|
|
@ -83,6 +83,12 @@ func (f FlagsByName) Swap(i, j int) {
|
|
|
|
|
f[i], f[j] = f[j], f[i]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ActionableFlag is an interface that wraps Flag interface and RunAction operation.
|
|
|
|
|
type ActionableFlag interface {
|
|
|
|
|
Flag
|
|
|
|
|
RunAction(*Context) error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Flag is a common interface related to parsing flags in cli.
|
|
|
|
|
// For more advanced flag parsing techniques, it is recommended that
|
|
|
|
|
// this interface be implemented.
|
|
|
|
@ -92,7 +98,6 @@ type Flag interface {
|
|
|
|
|
Apply(*flag.FlagSet) error
|
|
|
|
|
Names() []string
|
|
|
|
|
IsSet() bool
|
|
|
|
|
RunAction(*Context) error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// RequiredFlag is an interface that allows us to mark flags as required
|
|
|
|
|