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
scala -version returns exitCode = 1 #8503
Comments
Imported From: https://issues.scala-lang.org/browse/SI-8503?orig=1 |
Michele Esposito (mresposito) said: |
@som-snytt said: I would refactor -version to CompilerCommand to enforce that uniformity. Then the question is whether the current behavior is useful. I'm not sure why scalac differs from the runner, but arguably scalac -version foo.scala && scala Foo means I think my file was recompiled if it is run. I just wanted to make sure I always use the correct version of the compiler. Similarly, scala -Xshow-phases foo.scala && scala bar.scala just means I want to verify some info in the middle of the compound command. Maybe it needs the equivalent of -Xfatal-warnings, such as -Xfatal-info for the current behavior. |
Michele Esposito (mresposito) said: So, what do you think this should be changed to? I think that the correct behaviour would be to output to stderr, but return no error code |
@som-snytt said: apm@mara:~$ scalac -version
Scala compiler version 2.10.4-RC3 -- Copyright 2002-2013, LAMP/EPFL
apm@mara:~$ echo $?
0
apm@mara:~$ scalacm -version
Scala compiler version 2.11.0-RC3 -- Copyright 2002-2013, LAMP/EPFL
apm@mara:~$ echo $?
0
apm@mara:~$ scalacm -version junk.scala
Scala compiler version 2.11.0-RC3 -- Copyright 2002-2013, LAMP/EPFL
apm@mara:~$ echo $?
0 The difference is: apm@mara:~$ scalam -version
Scala code runner version 2.11.0-RC3 -- Copyright 2002-2013, LAMP/EPFL
apm@mara:~$ echo $?
1 My proposal was that you can request whether info messages result in a non-zero exit code. |
@som-snytt said: |
From the command line if I enter "scala -version" it returns with exitCode = 1, and outputs to stderr "Scala code runner version 2.10.3 -- Copyright 2002-2013, LAMP/EPFL"
Just asking that the version should not be an error.
The text was updated successfully, but these errors were encountered: