From c0b4764683b594d0ded191a87a35eb529c21c073 Mon Sep 17 00:00:00 2001 From: Michael Allman Date: Sat, 26 Nov 2011 16:30:38 -0800 Subject: [PATCH 1/2] Print the launcher version and exit if it's passed exactly one argument named "--version" --- launch/Boot.scala | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/launch/Boot.scala b/launch/Boot.scala index 992f991c5..65ded1ecd 100644 --- a/launch/Boot.scala +++ b/launch/Boot.scala @@ -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 From 26fe2594bc8ba936759f1cfff5b02c1aaf45a083 Mon Sep 17 00:00:00 2001 From: Michael Allman Date: Mon, 28 Nov 2011 23:23:14 -0800 Subject: [PATCH 2/2] Remove superfluous call to exit() in main() --- launch/Boot.scala | 1 - 1 file changed, 1 deletion(-) diff --git a/launch/Boot.scala b/launch/Boot.scala index 65ded1ecd..d65d8e041 100644 --- a/launch/Boot.scala +++ b/launch/Boot.scala @@ -13,7 +13,6 @@ object Boot 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()