Skip to content

Instantly share code, notes, and snippets.

@seaneagan
Created April 23, 2012 13:11
Show Gist options
  • Select an option

  • Save seaneagan/2470832 to your computer and use it in GitHub Desktop.

Select an option

Save seaneagan/2470832 to your computer and use it in GitHub Desktop.
Command
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