0

When using the Scala interpreter, one could start it with an option like:

C:\Users\John>scala -unchecked
Welcome to Scala version 2.9.2 (Java HotSpot(TM) Client VM, Java 1.6.0_32).
Type in expressions to have them evaluated.
Type :help for more information.

scala>

When using sbt, how can one start the Scala interpreter with options ? The following try will not work:

C:\Users\John\Test Scala Project 1>sbt
[...]
[info] Loading global plugins from C:\Users\John\.sbt\plugins
[info] Set current project to default-8d4ecc (in build file:/C:/Users/John/Tes
t%20Scala%20Project%201/)
> console -unchecked
[error] Expected end of input.
[error] console -unchecked
[error]        ^

With Google & Co I could not figure out how to do this from within the sbt shell. Does anyone know ?

John Threepwood
  • 15,593
  • 27
  • 93
  • 149

1 Answers1

2
dcs@shadowfax:~/github/ConwayLife (master *)$ sbt
[info] Loading global plugins from /home/dcs/.sbt/plugins/project
[info] Loading global plugins from /home/dcs/.sbt/plugins
[info] Loading project definition from /home/dcs/github/ConwayLife/project
[info] Set current project to default-0d85ea (in build file:/home/dcs/github/ConwayLife/)
default-0d85ea:master>set scalacOptions += "-unchecked"
[info] Reapplying settings...
[info] Set current project to default-0d85ea (in build file:/home/dcs/github/ConwayLife/)
Daniel C. Sobral
  • 295,120
  • 86
  • 501
  • 681
  • 1
    Just a note: You probably want to avoid sending `-optimise` to the REPL. You should also use REPL specific optins with: set scalacOption in (Compile, console) += "-SomeSpecificOption)" – jsuereth Oct 26 '13 at 13:22