summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/GenericRunnerSettings.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-03-16 07:49:16 +0000
committerPaul Phillips <paulp@improving.org>2011-03-16 07:49:16 +0000
commiteb0b73b1160c7e62e2ae0e338a9664b8b53ddbde (patch)
treed1836661a909a33fc805d302183741868582876f /src/compiler/scala/tools/nsc/GenericRunnerSettings.scala
parentf80801c67545a28f61abd1a36a5ef8b5bc337d87 (diff)
downloadscala-eb0b73b1160c7e62e2ae0e338a9664b8b53ddbde.tar.gz
scala-eb0b73b1160c7e62e2ae0e338a9664b8b53ddbde.tar.bz2
scala-eb0b73b1160c7e62e2ae0e338a9664b8b53ddbde.zip
Undoing some much too hacky code to implement a...
Undoing some much too hacky code to implement a -jar option and then following wherever that led me. Tangible results include: * much beautified scala -help, including documenting some things never before documented in this plane of existence * an improved Jar abstraction * further systemization of system properties In addition, the jars created by -savecompiled are given the right manifest so the jar is runnable. That means you can: scala -savecompiled bippy.scala arg1 arg2 scala -jar bippy.scala.jar arg1 arg2 And both lines should yield the same result. No review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/GenericRunnerSettings.scala')
-rw-r--r--src/compiler/scala/tools/nsc/GenericRunnerSettings.scala19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/compiler/scala/tools/nsc/GenericRunnerSettings.scala b/src/compiler/scala/tools/nsc/GenericRunnerSettings.scala
index a7c5ce4ae1..bd0ea4a4ba 100644
--- a/src/compiler/scala/tools/nsc/GenericRunnerSettings.scala
+++ b/src/compiler/scala/tools/nsc/GenericRunnerSettings.scala
@@ -3,17 +3,19 @@
* @author Lex Spoon
*/
-
package scala.tools.nsc
-class GenericRunnerSettings(error: String => Unit)
-extends Settings(error) {
+class GenericRunnerSettings(error: String => Unit) extends Settings(error) {
+ // A -jar option means the remainder of the command line should be
+ // passed to the main program in the jar. If -jar is given, jarfile
+ // will be set, but we also need to prepend the jar to the classpath
+ // since it may not be there.
val jarfile =
StringSetting(
"-jar",
"jar",
"Specify the jarfile in which to look for the main class",
- "")
+ "").stopProcessing() withPostSetHook (classpath prepend _.value)
val howtorun =
ChoiceSetting(
@@ -41,8 +43,9 @@ extends Settings(error) {
"-savecompiled",
"save the compiled script (assumes the code is a script)")
- val nocompdaemon =
- BooleanSetting(
- "-nocompdaemon",
- "do not use the fsc compilation daemon")
+ val nc = BooleanSetting(
+ "-nc",
+ "do not use the fsc compilation daemon") withAbbreviation "-nocompdaemon"
+
+ @deprecated("Use `nc` instead") def nocompdaemon = nc
}