string slice flag option formatting

Used to output:
```
-- 'name'          -name option -name option%!(EXTRA string=Usage text)
```

Now:
```
--name []          `-name option -name option` Usage text
```
This commit is contained in:
Ryan S. Brown 2013-12-02 13:21:31 -06:00
parent a4d75ab69e
commit 28cf49a4ca

View File

@ -54,7 +54,7 @@ type StringSliceFlag struct {
}
func (f StringSliceFlag) String() string {
return fmt.Sprintf("%s '%v'\t%v", prefixFor(f.Name), f.Name, "-"+f.Name+" option -"+f.Name+" option", f.Usage)
return fmt.Sprintf("%s%s %v\t`%v` %s", prefixFor(f.Name), f.Name, f.Value, "-"+f.Name+" option -"+f.Name+" option", f.Usage)
}
func (f StringSliceFlag) Apply(set *flag.FlagSet) {