     /// The name of the tool to be run.
     var launchPath: String { get }
     
-    /// `true` when the output of the tool should be printed to `stdout`.
-    var printOutput: Bool { get }
-
     /// Runs the tool and returns result of the execution.
     func run(args: [String]) -> (out: String, err: String, code: Int32)
 

    }
}

struct SwiftTool : Tool {
    let launchPath: String
    
    init?() {
        let which = WhichTool()
        let result = which.run("swiftc")
        if result.out.characters.count == 0 { return nil }
        self.launchPath = result.out
    }
}

struct ApousScriptTool : Tool {
    let launchPath = "./.apousscript"
}

}

extension Tool {
    
    /// Runs the tool and returns result of the execution.
    func run(args: String...) -> (out: String, err: String, code: Int32) {
        return run(args)
    }

    /// Provides a default implementation for `run` so that all consumers can make use
    /// of the default behavior of simply running and outputting to `stdout` and `stderr`.
    func run(args: [String]) -> (out: String, err: String, code: Int32) {
        // HACK(owensd): I cannot figure out why this tool will not flush our to stdout in real-time,
        // so forcing it to write to stdout for now.
        let output = NSFileHandle.fileHandleWithStandardOutput()
        let error = NSFileHandle.fileHandleWithStandardError()
        
        var out = ""
        var err = ""
        
        func stream(handle: NSFileHandle) -> String {
            let data = handle.availableData
            let str = NSString(data: data, encoding: NSUTF8StringEncoding) ?? ""
            return str as String
        }
        
        // NOTE(owensd): These don't work for stdout and stderr...
        output.readabilityHandler = { out += stream($0) }
        error.readabilityHandler = { err += stream($0) }
        
        let task = NSTask()
        task.launchPath = launchPath
        task.arguments = args
        task.standardOutput = output
        task.standardError = error
