File tree Expand file tree Collapse file tree 6 files changed +12
-4
lines changed
src/main/scala/de/upb/cs/swt/delphi/cli Expand file tree Collapse file tree 6 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ libraryDependencies ++= Seq(
22
22
)
23
23
24
24
libraryDependencies += " de.vandermeer" % " asciitable" % " 0.3.2"
25
+ libraryDependencies += " com.lihaoyi" %% " fansi" % " 0.2.5"
26
+ libraryDependencies += " org.scala-lang" % " scala-reflect" % scalaVersion.value
25
27
26
28
debianPackageDependencies := Seq (" java8-runtime-headless" )
27
29
Original file line number Diff line number Diff line change @@ -25,6 +25,11 @@ class ConsoleOutput(config: Config) {
25
25
if (! config.silent) println(value)
26
26
}
27
27
28
+ def outputSuccess (value : String ) : Unit = {
29
+ // noinspection ScalaStyle
30
+ if (! config.silent) println(fansi.Color .Green (value))
31
+ }
32
+
28
33
def outputResult (value : Any ): Unit = {
29
34
// noinspection ScalaStyle
30
35
println(
@@ -44,6 +49,6 @@ class ConsoleOutput(config: Config) {
44
49
45
50
def outputError (value : String ) : Unit = {
46
51
// noinspection ScalaStyle
47
- println(value)
52
+ println(fansi. Color . Red ( value) )
48
53
}
49
54
}
Original file line number Diff line number Diff line change @@ -78,5 +78,6 @@ trait Command {
78
78
protected def information (implicit config : Config ): String => Unit = config.consoleOutput.outputInformation _
79
79
protected def reportResult (implicit config : Config ): Any => Unit = config.consoleOutput.outputResult _
80
80
protected def error (implicit config : Config ): String => Unit = config.consoleOutput.outputError _
81
+ protected def success (implicit config : Config ): String => Unit = config.consoleOutput.outputSuccess _
81
82
82
83
}
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ object RetrieveCommand extends Command with SprayJsonSupport with DefaultJsonPro
73
73
}
74
74
75
75
val unmarshalled = Await .result(unmarshalledFuture, Duration .Inf )
76
- information (config)(s " Found ${unmarshalled.size} item(s). " )
76
+ success (config)(s " Found ${unmarshalled.size} item(s). " )
77
77
reportResult(config)(unmarshalled)
78
78
79
79
Await .ready(unmarshalledFuture, Duration .Inf )
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ object SearchCommand extends Command with SprayJsonSupport with DefaultJsonProto
101
101
=> " "
102
102
}
103
103
}
104
- information (config)(s " Found ${unmarshalled.size} item(s). $capMessage" )
104
+ success (config)(s " Found ${unmarshalled.size} item(s). $capMessage" )
105
105
reportResult(config)(unmarshalled)
106
106
107
107
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ object TestCommand extends Command {
27
27
override def execute (config : Config )(implicit system : ActorSystem ): Unit = executeGet(
28
28
" /version"
29
29
)(config, system).map(s => {
30
- information (config)(" Successfully contacted Delphi server. " )
30
+ success (config)(" Successfully contacted Delphi server. " )
31
31
information(config)(" Server version: " + s)
32
32
})
33
33
}
You can’t perform that action at this time.
0 commit comments