]> Cypherpunks repositories - gostls13.git/commit
flag: align multi-line usage strings
authorTim Cooper <tim.cooper@layeh.com>
Wed, 27 Sep 2017 23:31:55 +0000 (20:31 -0300)
committerRuss Cox <rsc@golang.org>
Thu, 28 Sep 2017 20:45:32 +0000 (20:45 +0000)
commit0828ec1ea8f1733d61db0893fe8c03abbcebc2e5
treecbccc79b285e4464724aa09871420aa0c3397b50
parentded2c65db3cf8c7f03e42d315b22a6b734246a32
flag: align multi-line usage strings

Previously, a multi-line flag usage string would not be indented with the
rest of the usage strings. This made long usage strings difficult to read.

For example, the usage for flag.String("A", "", "1\n2\n3") would be printed
as:

  -A 1
2
3

But will now be printed as:

  -A 1
     2
     3

Also fixes a slight error in the FlagSet.PrintDefaults documentation.

Fixes #20799

Change-Id: I4379c6b7590fdb93a2809a01046a0f6ae32c3e5d
Reviewed-on: https://go-review.googlesource.com/66711
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/flag/flag.go
src/flag/flag_test.go