summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/Properties.scala
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2015-06-22 20:56:40 -0700
committerSom Snytt <som.snytt@gmail.com>2015-06-23 15:52:01 -0700
commit934a31488b43b75a5b437e0cb293b6b5b4f076d7 (patch)
tree0e5e85a6125fb56eff158b633495f643a4abc200 /src/compiler/scala/tools/nsc/Properties.scala
parent1b9cb466430b6300355185917257493ca2e6a240 (diff)
downloadscala-934a31488b43b75a5b437e0cb293b6b5b4f076d7.tar.gz
scala-934a31488b43b75a5b437e0cb293b6b5b4f076d7.tar.bz2
scala-934a31488b43b75a5b437e0cb293b6b5b4f076d7.zip
SI-9206: REPL custom welcome message
Can be specified by `-Dscala.repl.welcome=Greeting` or in properties file. It takes the same format arguments as the prompt, viz, version, Java version and JVM name. It can be disabled by `-Dscala.repl.welcome` with no text.
Diffstat (limited to 'src/compiler/scala/tools/nsc/Properties.scala')
-rw-r--r--src/compiler/scala/tools/nsc/Properties.scala9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/Properties.scala b/src/compiler/scala/tools/nsc/Properties.scala
index ca7d8776d4..c8b9922623 100644
--- a/src/compiler/scala/tools/nsc/Properties.scala
+++ b/src/compiler/scala/tools/nsc/Properties.scala
@@ -12,8 +12,17 @@ object Properties extends scala.util.PropertiesTrait {
protected def pickJarBasedOn = classOf[Global]
// settings based on jar properties, falling back to System prefixed by "scala."
+
+ // messages to display at startup or prompt, format string with string parameters
+ // Scala version, Java version, JVM name
def residentPromptString = scalaPropOrElse("resident.prompt", "\nnsc> ")
def shellPromptString = scalaPropOrElse("shell.prompt", "%nscala> ")
+ def shellWelcomeString = scalaPropOrElse("shell.welcome",
+ """Welcome to Scala %1$s (%3$s, Java %2$s).
+ |Type in expressions to have them evaluated.
+ |Type :help for more information.""".stripMargin
+ )
+
// message to display at EOF (which by default ends with
// a newline so as not to break the user's terminal)
def shellInterruptedString = scalaPropOrElse("shell.interrupted", f":quit$lineSeparator")