aboutsummaryrefslogtreecommitdiff
path: root/flag.go
diff options
context:
space:
mode:
authorDaniel Nephin <[email protected]>2016-10-18 11:20:37 -0700
committerDaniel Nephin <[email protected]>2016-10-18 11:20:37 -0700
commitf2a61de59b416a221708c3943926ef417d17efed (patch)
tree67c0ed1945717dcfb2545f7c9ae3592274d88e10 /flag.go
parentbf8481a6aebc13a8aab52e699ffe2e79771f5a3f (diff)
Don't print escaped strings for the default value of string flags.
Signed-off-by: Daniel Nephin <[email protected]>
Diffstat (limited to 'flag.go')
-rw-r--r--flag.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/flag.go b/flag.go
index 4258f45..d9aee57 100644
--- a/flag.go
+++ b/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)