Update vendor directory
This commit is contained in:
23
vendor/github.com/jessevdk/go-flags/group.go
generated
vendored
23
vendor/github.com/jessevdk/go-flags/group.go
generated
vendored
@@ -34,6 +34,9 @@ type Group struct {
|
||||
// The namespace of the group
|
||||
Namespace string
|
||||
|
||||
// The environment namespace of the group
|
||||
EnvNamespace string
|
||||
|
||||
// If true, the group is not displayed in the help or man page
|
||||
Hidden bool
|
||||
|
||||
@@ -70,6 +73,13 @@ func (g *Group) AddGroup(shortDescription string, longDescription string, data i
|
||||
return group, nil
|
||||
}
|
||||
|
||||
// AddOption adds a new option to this group.
|
||||
func (g *Group) AddOption(option *Option, data interface{}) {
|
||||
option.value = reflect.ValueOf(data)
|
||||
option.group = g
|
||||
g.options = append(g.options, option)
|
||||
}
|
||||
|
||||
// Groups returns the list of groups embedded in this group.
|
||||
func (g *Group) Groups() []*Group {
|
||||
return g.groups
|
||||
@@ -165,6 +175,18 @@ func (g *Group) optionByName(name string, namematch func(*Option, string) bool)
|
||||
return retopt
|
||||
}
|
||||
|
||||
func (g *Group) showInHelp() bool {
|
||||
if g.Hidden {
|
||||
return false
|
||||
}
|
||||
for _, opt := range g.options {
|
||||
if opt.showInHelp() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (g *Group) eachGroup(f func(*Group)) {
|
||||
f(g)
|
||||
|
||||
@@ -358,6 +380,7 @@ func (g *Group) scanSubGroupHandler(realval reflect.Value, sfield *reflect.Struc
|
||||
}
|
||||
|
||||
group.Namespace = mtag.Get("namespace")
|
||||
group.EnvNamespace = mtag.Get("env-namespace")
|
||||
group.Hidden = mtag.Get("hidden") != ""
|
||||
|
||||
return true, nil
|
||||
|
||||
Reference in New Issue
Block a user