Skip to content
This repository was archived by the owner on Sep 1, 2020. It is now read-only.

Commit a9053f4

Browse files
committed
SI-9206 Verbose REPL prompt for info mode
Only for exactly `-Dscala.repl.info`, include the complete version number string in the REPL prompt. One could imagine this is the mode for posting snippets to stackoverflow.
1 parent c3aca10 commit a9053f4

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/repl/scala/tools/nsc/interpreter/ReplProps.scala

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
package scala.tools.nsc
77
package interpreter
88

9+
import Properties.shellPromptString
910
import scala.sys._
1011
import Prop._
1112

@@ -16,19 +17,19 @@ class ReplProps {
1617
// This property is used in TypeDebugging. Let's recycle it.
1718
val colorOk = bool("scala.color")
1819

20+
val info = bool("scala.repl.info")
21+
val debug = bool("scala.repl.debug")
22+
val trace = bool("scala.repl.trace")
23+
val power = bool("scala.repl.power")
24+
1925
// Handy system prop for shell prompt, or else pick it up from compiler.properties
20-
val promptString = Prop[String]("scala.repl.prompt").option getOrElse Properties.shellPromptString
26+
val promptString = Prop[String]("scala.repl.prompt").option getOrElse (if (info) "%nscala %s> " else shellPromptString)
2127
val prompt = {
2228
import scala.io.AnsiColor.{ MAGENTA, RESET }
2329
val p = promptString format Properties.versionNumberString
2430
if (colorOk) s"$MAGENTA$p$RESET" else p
2531
}
2632

27-
val info = bool("scala.repl.info")
28-
val debug = bool("scala.repl.debug")
29-
val trace = bool("scala.repl.trace")
30-
val power = bool("scala.repl.power")
31-
3233
/** CSV of paged,across to enable pagination or `-x` style
3334
* columns, "across" instead of down the column. Since
3435
* pagination turns off columnar output, these flags are

0 commit comments

Comments
 (0)