Add countable interface

This commit is contained in:
Naveen Gogineni
2022-09-05 19:13:26 -04:00
committed by Dan Buch
parent 6b0a3e80b5
commit a509290e75
3 changed files with 16 additions and 5 deletions

View File

@@ -124,6 +124,12 @@ type Flag interface {
GetValue() string
}
// Countable is an interface to enable detection of flag values which support
// repetitive flags
type Countable interface {
Count() int
}
func flagSet(name string, flags []Flag) (*flag.FlagSet, error) {
set := flag.NewFlagSet(name, flag.ContinueOnError)