migrated the apps to processes
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
package lib.cli;
|
||||
|
||||
using tink.CoreApi;
|
||||
|
||||
abstract class CLIApp {
|
||||
public abstract function invoke(handle: TermHandle): Future<Bool>;
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package lib.cli;
|
||||
|
||||
import haxe.ds.ReadOnlyArray;
|
||||
|
||||
typedef TermHandleEvents = {
|
||||
onWrite: String->Void,
|
||||
onNewLine: Void->Void,
|
||||
}
|
||||
|
||||
class TermHandle {
|
||||
public final args:ReadOnlyArray<String>;
|
||||
private final events:TermHandleEvents;
|
||||
|
||||
@:allow(bin.Terminal)
|
||||
private function new(args: Array<String>, events: TermHandleEvents) {
|
||||
this.args = args;
|
||||
this.events = events;
|
||||
}
|
||||
|
||||
public function write(s:String) {
|
||||
this.events.onWrite(s);
|
||||
}
|
||||
|
||||
public function writeLn(s:String = "") {
|
||||
if (s != "")
|
||||
this.events.onWrite(s);
|
||||
this.events.onNewLine();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user