summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorSimon Ochsenreither <simon@ochsenreither.de>2013-07-30 18:53:56 +0200
committerSimon Ochsenreither <simon@ochsenreither.de>2013-07-30 18:53:56 +0200
commit2b1563fa74e5e5f93b6eac4778fd59b785ac9a8d (patch)
tree90cd7a099335cf1e2b21aab00b0cccfc14d017e5 /src/compiler
parente5261645b9b7843c857a1685a436434a0e481cc9 (diff)
downloadscala-2b1563fa74e5e5f93b6eac4778fd59b785ac9a8d.tar.gz
scala-2b1563fa74e5e5f93b6eac4778fd59b785ac9a8d.tar.bz2
scala-2b1563fa74e5e5f93b6eac4778fd59b785ac9a8d.zip
Clean up ConsoleRunner, --> returns Boolean ...
... not Unit now.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/cmd/Opt.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/cmd/Opt.scala b/src/compiler/scala/tools/cmd/Opt.scala
index 5aee33ec4a..df3d0c4462 100644
--- a/src/compiler/scala/tools/cmd/Opt.scala
+++ b/src/compiler/scala/tools/cmd/Opt.scala
@@ -29,7 +29,7 @@ object Opt {
protected def opt = fromOpt(name)
def --? : Boolean // --opt is set
- def --> (body: => Unit): Unit // if --opt is set, execute body
+ def --> (body: => Unit): Boolean // if --opt is set, execute body
def --| : Option[String] // --opt <arg: String> is optional, result is Option[String]
def --^[T: FromString] : Option[T] // --opt <arg: T> is optional, result is Option[T]
@@ -51,7 +51,7 @@ object Opt {
import options._
def --? = { addUnary(opt) ; false }
- def --> (body: => Unit) = { addUnary(opt) }
+ def --> (body: => Unit) = { addUnary(opt) ; false }
def --| = { addBinary(opt) ; None }
def --^[T: FromString] = { addBinary(opt) ; None }
@@ -65,7 +65,7 @@ object Opt {
class Instance(val programInfo: Info, val parsed: CommandLine, val name: String) extends Implicit with Error {
def --? = parsed isSet opt
- def --> (body: => Unit) = if (parsed isSet opt) body
+ def --> (body: => Unit) = { val isSet = parsed isSet opt ; if (isSet) body ; isSet }
def --| = parsed get opt
def --^[T: FromString] = {
val fs = implicitly[FromString[T]]