File tree 1 file changed +31
-4
lines changed
src/main/scala/org/eprogramming/scalaesh
1 file changed +31
-4
lines changed Original file line number Diff line number Diff line change @@ -3,12 +3,39 @@ package org.esmerilprogramming.scalaesh
3
3
import java .io .File
4
4
import java .nio .file ._
5
5
6
+ import org .jboss .aesh .cl ._
7
+ import org .jboss .aesh .console ._
8
+ import org .jboss .aesh .console .command ._
9
+ import org .jboss .aesh .console .command .invocation ._
10
+ import org .jboss .aesh .console .command .registry ._
11
+ import org .jboss .aesh .console .settings ._
12
+ import org .jboss .aesh .extensions .harlem .aesh ._
13
+ import org .jboss .aesh .extensions .pwd ._
14
+ import java .io ._
15
+
16
+
6
17
/**
7
- * main app .
18
+ * simple aesh scala wrapper .
8
19
* author helio frota at gmail dot com.
9
20
*/
10
21
object ScalaeshApp extends App {
11
- println(" --------------------" )
12
- println(" initial structure..." )
13
- println(" --------------------" )
22
+
23
+ val pos = new PipedOutputStream ();
24
+ val pis = new PipedInputStream (pos);
25
+ val sb = new SettingsBuilder ()
26
+ .inputStream(pis)
27
+ .outputStream(new MtermPrintStream (textSpace, baos));
28
+
29
+ val registry = new AeshCommandRegistryBuilder ()
30
+ .command(new Harlem ())
31
+ .command(new Pwd ())
32
+ .create();
33
+
34
+ val aeshConsole = new AeshConsoleBuilder ()
35
+ .commandRegistry(registry)
36
+ .settings(sb.create())
37
+ .prompt(new Prompt (" $ " ))
38
+ .create();
39
+ aeshConsole.start();
40
+
14
41
}
You can’t perform that action at this time.
0 commit comments