Porting remainder of #796

This commit is contained in:
2022-04-22 15:00:43 -04:00
parent 44958693a1
commit 75e4ee69e9
18 changed files with 112 additions and 12 deletions

10
flag.go
View File

@@ -94,8 +94,6 @@ type Flag interface {
Apply(*flag.FlagSet) error
Names() []string
IsSet() bool
GetCategory() string
GetHidden() bool
}
// RequiredFlag is an interface that allows us to mark flags as required
@@ -135,6 +133,14 @@ type VisibleFlag interface {
IsVisible() bool
}
// CategorizableFlag is an interface that allows us to potentially
// use a flag in a categorized representation.
type CategorizableFlag interface {
VisibleFlag
GetCategory() string
}
func flagSet(name string, flags []Flag) (*flag.FlagSet, error) {
set := flag.NewFlagSet(name, flag.ContinueOnError)