Issue #1066: Display (accepts multiple inputs)
for SliceFlags in the
help description.
This commit is contained in:
committed by
Madhur Batra
parent
fe989e1a7a
commit
ea14b62ecc
6
flag.go
6
flag.go
@@ -359,7 +359,11 @@ func stringifySliceFlag(usage string, names, defaultVals []string) string {
|
||||
}
|
||||
|
||||
usageWithDefault := strings.TrimSpace(fmt.Sprintf("%s%s", usage, defaultVal))
|
||||
return fmt.Sprintf("%s\t%s", prefixedNames(names, placeholder), usageWithDefault)
|
||||
multiInputString := "(accepts multiple inputs)"
|
||||
if usageWithDefault != "" {
|
||||
multiInputString = "\t" + multiInputString
|
||||
}
|
||||
return fmt.Sprintf("%s\t%s%s", prefixedNames(names, placeholder), usageWithDefault, multiInputString)
|
||||
}
|
||||
|
||||
func hasFlag(flags []Flag, fl Flag) bool {
|
||||
|
Reference in New Issue
Block a user