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

Print usage to stdout when invoked with -help/-X/-Y #10178

Closed
scabug opened this issue Feb 9, 2017 · 5 comments
Closed

Print usage to stdout when invoked with -help/-X/-Y #10178

scabug opened this issue Feb 9, 2017 · 5 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Feb 9, 2017

Scala should print usage information to stdout instead of stderr. While errors about command line arguments should be printed to stderr, when explicitly asked for help this info should go to stdout. This allows it to be piped to grep or less, etc. It's also in the GNU coding standards, and seems to be a lot more useful in general.

http://www.gnu.org/prep/standards/html_node/_002d_002dhelp.html

@scabug
Copy link
Author

scabug commented Feb 9, 2017

Imported From: https://issues.scala-lang.org/browse/SI-10178?orig=1
Reporter: @dragos
Affected Versions: 2.12.1
See #9154

@scabug
Copy link
Author

scabug commented Feb 9, 2017

@som-snytt said:
This gets me all the time, too. javac -X outputs to stderr.

@scabug
Copy link
Author

scabug commented Feb 10, 2017

@dragos said (edited on Feb 10, 2017 2:18:14 PM UTC):
I would deviate from Java on this point, since the intention of passing -X or -Y is really to get usage information. I also grep those way more often than the regular ones. I guess stderr made sense if scalac output was pipeable to other processes and errors/diagnostics would confuse them. However, for scalac the only output that's worth piping is usage information.

@scabug
Copy link
Author

scabug commented Feb 10, 2017

@som-snytt said:
The linked issue is about not grepping -X output.

@scabug
Copy link
Author

scabug commented Feb 17, 2017

@dragos said:
scala/scala#5714

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants