aboutsummaryrefslogtreecommitdiff
path: root/flag.go
diff options
context:
space:
mode:
authorMatthew Winter <[email protected]>2017-03-28 01:13:44 +1100
committerEric Paris <[email protected]>2017-03-27 09:13:44 -0500
commitd16db1e50e33dff1b6cdf37596cef36742128670 (patch)
tree4a18dd93cf381d88adc8ef55b99fd273e7ea024b /flag.go
parentd90f37a48761fe767528f31db1955e4f795d652f (diff)
Modified to display a string default value as double quoted and escaped (#118)
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 7ebf33e..cb57359 100644
--- a/flag.go
+++ b/flag.go
@@ -628,7 +628,7 @@ func (f *FlagSet) FlagUsagesWrapped(cols int) string {
line += usage
if !flag.defaultIsZeroValue() {
if flag.Value.Type() == "string" {
- line += fmt.Sprintf(" (default \"%s\")", flag.DefValue)
+ line += fmt.Sprintf(" (default %q)", flag.DefValue)
} else {
line += fmt.Sprintf(" (default %s)", flag.DefValue)
}