diff options
author | Niall Sheridan <nsheridan@gmail.com> | 2016-10-31 16:36:17 +0000 |
---|---|---|
committer | Niall Sheridan <nsheridan@gmail.com> | 2016-10-31 16:40:08 +0000 |
commit | e0a1ccb64a637673195804513902cba6b1d4e97c (patch) | |
tree | abc1598be28cda231d92cda8fb10b49eeb564c29 /vendor/github.com/spf13/pflag | |
parent | 7bad329d417f19ba4aae2b4607281c2bc5df8ad7 (diff) |
Update dependencies
Diffstat (limited to 'vendor/github.com/spf13/pflag')
-rw-r--r-- | vendor/github.com/spf13/pflag/flag.go | 4 | ||||
-rw-r--r-- | vendor/github.com/spf13/pflag/string_array.go | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/vendor/github.com/spf13/pflag/flag.go b/vendor/github.com/spf13/pflag/flag.go index 4258f45..fa81564 100644 --- a/vendor/github.com/spf13/pflag/flag.go +++ b/vendor/github.com/spf13/pflag/flag.go @@ -514,7 +514,7 @@ func (f *FlagSet) FlagUsages() string { if len(flag.NoOptDefVal) > 0 { switch flag.Value.Type() { case "string": - line += fmt.Sprintf("[=%q]", flag.NoOptDefVal) + line += fmt.Sprintf("[=\"%s\"]", flag.NoOptDefVal) case "bool": if flag.NoOptDefVal != "true" { line += fmt.Sprintf("[=%s]", flag.NoOptDefVal) @@ -534,7 +534,7 @@ func (f *FlagSet) FlagUsages() string { line += usage if !flag.defaultIsZeroValue() { if flag.Value.Type() == "string" { - line += fmt.Sprintf(" (default %q)", flag.DefValue) + line += fmt.Sprintf(" (default \"%s\")", flag.DefValue) } else { line += fmt.Sprintf(" (default %s)", flag.DefValue) } diff --git a/vendor/github.com/spf13/pflag/string_array.go b/vendor/github.com/spf13/pflag/string_array.go index f320f2e..93b4e43 100644 --- a/vendor/github.com/spf13/pflag/string_array.go +++ b/vendor/github.com/spf13/pflag/string_array.go @@ -2,7 +2,6 @@ package pflag import ( "fmt" - "strings" ) var _ = fmt.Fprint @@ -40,7 +39,7 @@ func (s *stringArrayValue) String() string { } func stringArrayConv(sval string) (interface{}, error) { - sval = strings.Trim(sval, "[]") + sval = sval[1 : len(sval)-1] // An empty string would cause a array with one (empty) string if len(sval) == 0 { return []string{}, nil |