diff options
author | Paul Phillips <paulp@improving.org> | 2010-12-07 19:39:44 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-12-07 19:39:44 +0000 |
commit | 8c325affb4d0acb61b4f24dec8b5f1b8883f20d6 (patch) | |
tree | d88cbf51025844d42e14e9107f5d44b74af7bc0b | |
parent | 60a88e05b69af937f70101e5a4349520fabf44bf (diff) | |
download | scala-8c325affb4d0acb61b4f24dec8b5f1b8883f20d6.tar.gz scala-8c325affb4d0acb61b4f24dec8b5f1b8883f20d6.tar.bz2 scala-8c325affb4d0acb61b4f24dec8b5f1b8883f20d6.zip |
Made it possible to give :cp an argument with s...
Made it possible to give :cp an argument with spaces. Closes #3819, no
review.
-rw-r--r-- | src/compiler/scala/tools/nsc/InterpreterLoop.scala | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/InterpreterLoop.scala b/src/compiler/scala/tools/nsc/InterpreterLoop.scala index 0b344b3329..e182bb5f8a 100644 --- a/src/compiler/scala/tools/nsc/InterpreterLoop.scala +++ b/src/compiler/scala/tools/nsc/InterpreterLoop.scala @@ -28,6 +28,9 @@ trait InterpreterControl { // the default result means "keep running, and don't record that line" val defaultResult = Result(true, None) + private def isQuoted(s: String) = + (s.length >= 2) && (s.head == s.last) && ("\"'" contains s.head) + // a single interpreter command sealed abstract class Command extends Function1[List[String], Result] { def name: String @@ -240,7 +243,7 @@ class InterpreterLoop(in0: Option[BufferedReader], protected val out: PrintWrite val standardCommands: List[Command] = { import CommandImplicits._ List( - OneArg("cp", "add an entry (jar or directory) to the classpath", addClasspath), + LineArg("cp", "add an entry (jar or directory) to the classpath", addClasspath), NoArgs("help", "print this help message", printHelp), VarArgs("history", "show the history (optional arg: lines to show)", printHistory), LineArg("h?", "search the history", searchHistory), @@ -354,7 +357,7 @@ class InterpreterLoop(in0: Option[BufferedReader], protected val out: PrintWrite if (f.exists) { addedClasspath = ClassPath.join(addedClasspath, f.path) val totalClasspath = ClassPath.join(settings.classpath.value, addedClasspath) - println("Added '%s'. Your new classpath is:\n%s".format(f.path, totalClasspath)) + println("Added '%s'. Your new classpath is:\n\"%s\"".format(f.path, totalClasspath)) replay() } else out.println("The path '" + f + "' doesn't seem to exist.") |