Created
April 23, 2012 13:11
-
-
Save seaneagan/2470832 to your computer and use it in GitHub Desktop.
Command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface Command { | |
| const Command(this.executable, [this.arguments, this.workingDirectory, this.environment]); | |
| String get executable(); | |
| List get arguments(); // toString() will get called on each argument | |
| String get workingDirectory(); | |
| Map<String, String> get environment(); | |
| Future<CommandResult> run([ | |
| Encoding stdoutEncoding, | |
| Encoding stderrEncoding, | |
| String stdin]); | |
| Process start(); | |
| } | |
| interface CommandResult { | |
| final int exitCode; | |
| final String stdout; | |
| final String stderr; | |
| } | |
| interface Process { | |
| void set onStart(void callback()), | |
| void set onError(void callback(ProcessException error)), | |
| void set onExit(void callback(int exitCode)); | |
| void kill(); | |
| void close(); | |
| InputStream get stdout(); | |
| InputStream get stderr(); | |
| OutputStream get stdin(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment