flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chiwanp...@apache.org
Subject flink git commit: [FLINK-2947] [scala shell] Add color support to Scala Shell
Date Mon, 23 Nov 2015 12:01:19 GMT
Repository: flink
Updated Branches:
  refs/heads/master 68a69c76a -> cd7963cbe


[FLINK-2947] [scala shell] Add color support to Scala Shell


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/cd7963cb
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/cd7963cb
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/cd7963cb

Branch: refs/heads/master
Commit: cd7963cbe4286777c28d99d750259eef6ea67238
Parents: 68a69c7
Author: Chiwan Park <chiwanpark@apache.org>
Authored: Sat Nov 7 15:11:10 2015 +0900
Committer: Chiwan Park <chiwanpark@apache.org>
Committed: Mon Nov 23 21:00:23 2015 +0900

----------------------------------------------------------------------
 .../scala-2.10/org/apache/flink/api/scala/ILoopCompat.scala    | 2 ++
 .../scala-2.11/org/apache/flink/api/scala/ILoopCompat.scala    | 6 ++++++
 .../src/main/scala/org/apache/flink/api/scala/FlinkILoop.scala | 5 -----
 .../flink-scala-shell/start-script/start-scala-shell.sh        | 4 ++--
 4 files changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/cd7963cb/flink-staging/flink-scala-shell/src/main/scala-2.10/org/apache/flink/api/scala/ILoopCompat.scala
----------------------------------------------------------------------
diff --git a/flink-staging/flink-scala-shell/src/main/scala-2.10/org/apache/flink/api/scala/ILoopCompat.scala
b/flink-staging/flink-scala-shell/src/main/scala-2.10/org/apache/flink/api/scala/ILoopCompat.scala
index 797b420..7751751 100644
--- a/flink-staging/flink-scala-shell/src/main/scala-2.10/org/apache/flink/api/scala/ILoopCompat.scala
+++ b/flink-staging/flink-scala-shell/src/main/scala-2.10/org/apache/flink/api/scala/ILoopCompat.scala
@@ -26,4 +26,6 @@ class ILoopCompat(
     in0: Option[BufferedReader],
     out0: JPrintWriter)
     extends ILoop(in0, out0) {
+
+  override def prompt = "Scala-Flink> "
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/cd7963cb/flink-staging/flink-scala-shell/src/main/scala-2.11/org/apache/flink/api/scala/ILoopCompat.scala
----------------------------------------------------------------------
diff --git a/flink-staging/flink-scala-shell/src/main/scala-2.11/org/apache/flink/api/scala/ILoopCompat.scala
b/flink-staging/flink-scala-shell/src/main/scala-2.11/org/apache/flink/api/scala/ILoopCompat.scala
index c1be6db..1c395bb 100644
--- a/flink-staging/flink-scala-shell/src/main/scala-2.11/org/apache/flink/api/scala/ILoopCompat.scala
+++ b/flink-staging/flink-scala-shell/src/main/scala-2.11/org/apache/flink/api/scala/ILoopCompat.scala
@@ -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
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/cd7963cb/flink-staging/flink-scala-shell/src/main/scala/org/apache/flink/api/scala/FlinkILoop.scala
----------------------------------------------------------------------
diff --git a/flink-staging/flink-scala-shell/src/main/scala/org/apache/flink/api/scala/FlinkILoop.scala
b/flink-staging/flink-scala-shell/src/main/scala/org/apache/flink/api/scala/FlinkILoop.scala
index a26ac2e..bcc9ef3 100644
--- a/flink-staging/flink-scala-shell/src/main/scala/org/apache/flink/api/scala/FlinkILoop.scala
+++ b/flink-staging/flink-scala-shell/src/main/scala/org/apache/flink/api/scala/FlinkILoop.scala
@@ -175,11 +175,6 @@ class FlinkILoop(
   }
 
   /**
-   * CUSTOM START METHODS OVERRIDE:
-   */
-  override def prompt = "Scala-Flink> "
-
-  /**
    * custom welcome message
    */
   override def printWelcome() {

http://git-wip-us.apache.org/repos/asf/flink/blob/cd7963cb/flink-staging/flink-scala-shell/start-script/start-scala-shell.sh
----------------------------------------------------------------------
diff --git a/flink-staging/flink-scala-shell/start-script/start-scala-shell.sh b/flink-staging/flink-scala-shell/start-script/start-scala-shell.sh
index 0af2a9d..fd85897 100644
--- a/flink-staging/flink-scala-shell/start-script/start-scala-shell.sh
+++ b/flink-staging/flink-scala-shell/start-script/start-scala-shell.sh
@@ -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


Mime
View raw message