aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Nephin <[email protected]>2016-10-18 13:28:23 -0700
committerDaniel Nephin <[email protected]>2016-10-18 13:28:23 -0700
commit7597b2702729ebb651fc9bb2adac40bcc62db82d (patch)
tree98a4b6bf55b492cb5a5a4c4697c401d527876fa1
parent0e7ce96826adebbd2556517e0a993030ef3a0c51 (diff)
Don't print escaped strings for the default value of string flags with a default is set.
Signed-off-by: Daniel Nephin <[email protected]>
-rw-r--r--flag.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/flag.go b/flag.go
index d9aee57..fa81564 100644
--- a/flag.go
+++ b/flag.go
@@ -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)
}