Skip to content

Commit

Permalink
[FLINK-2947] [scala shell] Add color support to Scala Shell
Browse files Browse the repository at this point in the history
  • Loading branch information
chiwanpark committed Nov 23, 2015
1 parent 68a69c7 commit cd7963c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ class ILoopCompat(
in0: Option[BufferedReader],
out0: JPrintWriter)
extends ILoop(in0, out0) {

override def prompt = "Scala-Flink> "
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,17 @@ package org.apache.flink.api.scala
import java.io.BufferedReader

import _root_.scala.tools.nsc.interpreter._
import _root_.scala.io.AnsiColor.{MAGENTA, RESET}

class ILoopCompat(
in0: Option[BufferedReader],
out0: JPrintWriter)
extends ILoop(in0, out0) {

override def prompt = {
val promptStr = "Scala-Flink> "
s"$MAGENTA$promptStr$RESET"
}

protected def addThunk(f: => Unit): Unit = f
}
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,6 @@ class FlinkILoop(
jarFilePath
}

/**
* CUSTOM START METHODS OVERRIDE:
*/
override def prompt = "Scala-Flink> "

/**
* custom welcome message
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ done

if ${EXTERNAL_LIB_FOUND}
then
java -cp "$FLINK_CLASSPATH" org.apache.flink.api.scala.FlinkShell $@ --addclasspath "$EXT_CLASSPATH"
java -Dscala.color -cp "$FLINK_CLASSPATH" org.apache.flink.api.scala.FlinkShell $@ --addclasspath "$EXT_CLASSPATH"
else
java -cp "$FLINK_CLASSPATH" org.apache.flink.api.scala.FlinkShell $@
java -Dscala.color -cp "$FLINK_CLASSPATH" org.apache.flink.api.scala.FlinkShell $@
fi

#restore echo
Expand Down

0 comments on commit cd7963c

Please sign in to comment.