Print the launcher version and exit if it's passed exactly one argument named "--version"

This commit is contained in:
Michael Allman 2011-11-26 16:30:38 -08:00
parent 2f52884df8
commit c0b4764683
1 changed files with 9 additions and 3 deletions

View File

@ -10,9 +10,15 @@ object Boot
{
def main(args: Array[String])
{
System.clearProperty("scala.home") // avoid errors from mixing Scala versions in the same JVM
CheckProxy()
run(args)
args match {
case Array("--version") =>
println("sbt launcher version " + Package.getPackage("xsbt.boot").getImplementationVersion)
exit(0)
case _ =>
System.clearProperty("scala.home") // avoid errors from mixing Scala versions in the same JVM
CheckProxy()
run(args)
}
}
// this arrangement is because Scala 2.7.7 does not properly optimize away
// the tail recursion in a catch statement