Replace all "stringly typed" fields with slice equivalents

and alter the Flag interface accordingly

Closes #415
This commit is contained in:
Dan Buch
2016-05-21 21:29:45 -04:00
parent 65357985c2
commit 81fcf706ea
11 changed files with 314 additions and 256 deletions

View File

@@ -208,11 +208,11 @@ func printHelp(out io.Writer, templ string, data interface{}) {
func checkVersion(c *Context) bool {
found := false
if VersionFlag.Name != "" {
eachName(VersionFlag.Name, func(name string) {
for _, name := range VersionFlag.Names() {
if c.Bool(name) {
found = true
}
})
}
}
return found
}
@@ -220,11 +220,11 @@ func checkVersion(c *Context) bool {
func checkHelp(c *Context) bool {
found := false
if HelpFlag.Name != "" {
eachName(HelpFlag.Name, func(name string) {
for _, name := range HelpFlag.Names() {
if c.Bool(name) {
found = true
}
})
}
}
return found
}