package flag
import "github.com/Microsoft/hcsshim/test/pkg/flag"
Index ¶
- Constants
- type IncludeExcludeStringSet
- func NewFeatureFlag(features []string) *IncludeExcludeStringSet
- func NewIncludeExcludeStringSet(include *StringSet, name, usage string, all []string) *IncludeExcludeStringSet
- func (es *IncludeExcludeStringSet) IsSet(s string) bool
- func (es *IncludeExcludeStringSet) Len() int
- func (es *IncludeExcludeStringSet) Set(s string) error
- func (es *IncludeExcludeStringSet) String() string
- func (es *IncludeExcludeStringSet) Strings() []string
- type LogrusLevel
- func NewLogrusLevel(name, value, usage string) *LogrusLevel
- func (l *LogrusLevel) Set(s string) error
- func (l *LogrusLevel) String() string
- type StringSet
Constants ¶
const ( FeatureFlagName = "feature" ExcludeFeatureFlagName = "exclude" )
Types ¶
type IncludeExcludeStringSet ¶
type IncludeExcludeStringSet struct {
// contains filtered or unexported fields
}
IncludeExcludeStringSet allows unsetting strings seen in a StringSet.
func NewFeatureFlag ¶
func NewFeatureFlag(features []string) *IncludeExcludeStringSet
NewFeatureFlag defines two flags, FeatureFlagName and ExcludeFeatureFlagName, to allow setting and excluding certain features.
func NewIncludeExcludeStringSet ¶
func NewIncludeExcludeStringSet(include *StringSet, name, usage string, all []string) *IncludeExcludeStringSet
NewIncludeExcludeStringSet returns a new NewIncludeExcludeStringSet.
func (*IncludeExcludeStringSet) IsSet ¶
func (es *IncludeExcludeStringSet) IsSet(s string) bool
func (*IncludeExcludeStringSet) Len ¶
func (es *IncludeExcludeStringSet) Len() int
func (*IncludeExcludeStringSet) Set ¶
func (es *IncludeExcludeStringSet) Set(s string) error
func (*IncludeExcludeStringSet) String ¶
func (es *IncludeExcludeStringSet) String() string
func (*IncludeExcludeStringSet) Strings ¶
func (es *IncludeExcludeStringSet) Strings() []string
type LogrusLevel ¶
LogrusLevel is a flag that accepts logrus logging levels as strings.
func NewLogrusLevel ¶
func NewLogrusLevel(name, value, usage string) *LogrusLevel
func (*LogrusLevel) Set ¶
func (l *LogrusLevel) Set(s string) error
func (*LogrusLevel) String ¶
func (l *LogrusLevel) String() string
type StringSet ¶
type StringSet struct {
// contains filtered or unexported fields
}
StringSet is a type to be used with the standard library's flag.Var function as a custom flag value, similar to "github.com/urfave/cli".StringSet, but it only tracks unique instances.
It takes either a comma-separated list of strings, or repeated invocations.
func NewStringSet ¶
NewStringSet returns a new StringSetFlag with an empty set.
func (*StringSet) IsSet ¶
func (*StringSet) Len ¶
func (*StringSet) Set ¶
Set is called by `flag` each time the flag is seen when parsing the command line.
func (*StringSet) String ¶
func (*StringSet) Strings ¶
Strings returns a string slice of the flags provided to the flag.
Source Files ¶
- Version
- v0.0.0-20250605171046-9b2e94f54499 (latest)
- Published
- Jun 5, 2025
- Platform
- linux/amd64
- Imports
- 4 packages
- Last checked
- 1 hour ago –
Tools for package owners.