]> Cypherpunks repositories - gostls13.git/commit
flag: make default Usage prefer CommandLine's output over just os.Stderr
authorBrad Fitzpatrick <bradfitz@golang.org>
Thu, 13 Jul 2017 17:28:54 +0000 (17:28 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 8 Aug 2017 01:47:47 +0000 (01:47 +0000)
commite1f38ccab14d27b934f0ebe7282fad556a788dd6
treec8b91a83980533cfd8eb6599fd9efd3bc6b99180
parent579120323fdf0c6939fa3e3c6c63b669b6437e31
flag: make default Usage prefer CommandLine's output over just os.Stderr

CommandLine (exported in Go 1.2) has default output of os.Stderr.

Before it was exported, it made sense to have the global Usage func
(the implicit usage func if CommandLine.Usage is nil) hard-code
os.Stderr has its output. But once CommandLine was exported, Usage
should use it if provided.

Fixes #20998

Change-Id: I9e1c0415a563a982634b9808199c9ee175d72f4c
Reviewed-on: https://go-review.googlesource.com/48390
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
src/flag/export_test.go
src/flag/flag.go
src/flag/flag_test.go