summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Racic <iracic@murex.com>2015-04-13 19:50:06 +0200
committerSom Snytt <som.snytt@gmail.com>2015-06-23 15:52:11 -0700
commit2ceb09c1a51694d1a17378ee8833154aa59b6c58 (patch)
tree965b60ebc8caead8dbe5453644d8689f62781d57
parent934a31488b43b75a5b437e0cb293b6b5b4f076d7 (diff)
downloadscala-2ceb09c1a51694d1a17378ee8833154aa59b6c58.tar.gz
scala-2ceb09c1a51694d1a17378ee8833154aa59b6c58.tar.bz2
scala-2ceb09c1a51694d1a17378ee8833154aa59b6c58.zip
SI-9206: REPL custom history file
Specify it with -Dscala.shell.histfile=/path/to/file.
-rw-r--r--src/repl-jline/scala/tools/nsc/interpreter/jline/FileBackedHistory.scala12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/repl-jline/scala/tools/nsc/interpreter/jline/FileBackedHistory.scala b/src/repl-jline/scala/tools/nsc/interpreter/jline/FileBackedHistory.scala
index b6c9792ec0..53a06ca972 100644
--- a/src/repl-jline/scala/tools/nsc/interpreter/jline/FileBackedHistory.scala
+++ b/src/repl-jline/scala/tools/nsc/interpreter/jline/FileBackedHistory.scala
@@ -7,9 +7,9 @@ package scala.tools.nsc.interpreter.jline
import _root_.jline.console.history.PersistentHistory
-
import scala.tools.nsc.interpreter
-import scala.tools.nsc.io.{File, Path}
+import scala.reflect.io.{ File, Path }
+import scala.tools.nsc.Properties.{ propOrNone, userHome }
/** TODO: file locking.
*/
@@ -85,9 +85,9 @@ object FileBackedHistory {
// val ContinuationChar = '\003'
// val ContinuationNL: String = Array('\003', '\n').mkString
- import scala.tools.nsc.Properties.userHome
-
- def defaultFileName = ".scala_history"
+ final val defaultFileName = ".scala_history"
- def defaultFile: File = File(Path(userHome) / defaultFileName)
+ def defaultFile: File = File(
+ propOrNone("scala.shell.histfile") map (Path.apply) getOrElse (Path(userHome) / defaultFileName)
+ )
}