From 28cf49a4cac2a9dee037d2a7f984df4ea4db602c Mon Sep 17 00:00:00 2001 From: "Ryan S. Brown" Date: Mon, 2 Dec 2013 13:21:31 -0600 Subject: [PATCH] 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 ``` --- flag.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flag.go b/flag.go index 7835b3b..faffbda 100644 --- a/flag.go +++ b/flag.go @@ -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) {