Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flag: cannot suppress output to os.Stderr #2747

Closed
rogpeppe opened this issue Jan 20, 2012 · 6 comments
Closed

flag: cannot suppress output to os.Stderr #2747

rogpeppe opened this issue Jan 20, 2012 · 6 comments
Milestone

Comments

@rogpeppe
Copy link
Contributor

Even with ContinueOnError, some messages are always printed to os.Stderr. This means
that it's not possible to collect the error messages when flag is used to parse options
from the other side of a network connection, for example; neither is it possible to
suppress all output to run a script quietly.

One backwardly compatible solution would be to add an output io.Writer
inside FlagSet and use os.Stderr if that's nil.

As a nice side effect, this could remove the spurious print when flag is tested.

354b17404643 weekly/weekly.2012-01-15
@robpike
Copy link
Contributor

robpike commented Jan 22, 2012

Comment 1:

Labels changed: added priority-go1, removed priority-triage.

Owner changed to builder@golang.org.

@rsc
Copy link
Contributor

rsc commented Jan 24, 2012

Comment 2:

Status changed to Accepted.

@bradfitz
Copy link
Contributor

Comment 3:

http://golang.org/cl/5564065

Owner changed to @bradfitz.

Status changed to Started.

@bradfitz
Copy link
Contributor

Comment 4:

This issue was closed by revision b79ba6a.

Status changed to Fixed.

@gopherbot
Copy link

Comment 5 by victorvieux:

What about here: https://code.google.com/p/go/source/browse/src/pkg/flag/flag.go#405 ?

@davecheney
Copy link
Contributor

Comment 6:

This issue was marked closed 18 months ago, please open a new issue.

Labels changed: added restrict-addissuecomment-commit.

@golang golang locked and limited conversation to collaborators Dec 8, 2014
@rsc rsc added this to the Go1 milestone Apr 10, 2015
@rsc rsc removed the priority-go1 label Apr 10, 2015
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants