From d16db1e50e33dff1b6cdf37596cef36742128670 Mon Sep 17 00:00:00 2001 From: Matthew Winter Date: Tue, 28 Mar 2017 01:13:44 +1100 Subject: Modified to display a string default value as double quoted and escaped (#118) --- flag.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'flag.go') 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) } -- cgit v1.2.3