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

Comments

Projects
None yet
2 participants
@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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Author

scabug commented Feb 9, 2017

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

@scabug

This comment has been minimized.

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

This comment has been minimized.

Copy link
Author

scabug commented Feb 10, 2017

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

@scabug

This comment has been minimized.

Copy link
Author

scabug commented Feb 17, 2017

@scabug scabug closed this Feb 20, 2017

@scabug scabug added this to the 2.12.2 milestone Apr 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.