@@ -13,34 +13,36 @@ import org.jboss.aesh.extensions.harlem.aesh._
13
13
import org .jboss .aesh .extensions .pwd ._
14
14
import java .io ._
15
15
16
- import org .jboss .aesh .terminal .TestTerminal
16
+ import org .jboss .aesh .terminal .{ Color , TerminalColor , TerminalString , TestTerminal }
17
17
18
18
19
19
/**
20
- * simple aesh scala wrapper.
21
- * author helio frota at gmail dot com.
22
- */
20
+ * simple aesh scala wrapper.
21
+ * author helio frota at gmail dot com.
22
+ */
23
23
object ScalaeshApp extends App {
24
24
25
25
val pos = new PipedOutputStream ();
26
26
val pis = new PipedInputStream (pos);
27
27
val baos = new ByteArrayOutputStream ();
28
28
29
29
val sb = new SettingsBuilder ()
30
- .terminal(new TestTerminal ())
31
- .inputStream(pis)
32
- .outputStream(new PrintStream (baos))
30
+ .terminal(new TestTerminal ())
31
+ .inputStream(pis)
32
+ .outputStream(new PrintStream (baos))
33
33
34
34
val registry = new AeshCommandRegistryBuilder ()
35
- .command(new Harlem ())
36
- .command(new Pwd ())
37
- .create();
35
+ .command(new Harlem ())
36
+ .command(new Pwd ())
37
+ .create();
38
38
39
39
val aeshConsole = new AeshConsoleBuilder ()
40
- .commandRegistry(registry)
41
- .settings(sb.create())
42
- .prompt(new Prompt (" $ " ))
43
- .create();
40
+ .commandRegistry(registry)
41
+ .settings(sb.create())
42
+ .prompt(new Prompt (new TerminalString (" [scalaesh@metal]$ " ,
43
+ new TerminalColor (Color .GREEN , Color .DEFAULT , Color .Intensity .BRIGHT ))))
44
+ .create();
45
+
44
46
aeshConsole.start();
45
47
46
48
}
0 commit comments