@@ -30,17 +30,11 @@ public struct Task {
3030 /// If nil, the launched task will inherit the environment of its parent.
3131 public var environment : [ String : String ] ?
3232
33- /// Data to stream to standard input of the launched process.
34- ///
35- /// If nil, stdin will be inherited from the parent process.
36- public var standardInput : SignalProducer < NSData , NoError > ?
37-
38- public init ( _ launchPath: String , arguments: [ String ] = [ ] , workingDirectoryPath: String ? = nil , environment: [ String : String ] ? = nil , standardInput: SignalProducer < NSData , NoError > ? = nil ) {
33+ public init ( _ launchPath: String , arguments: [ String ] = [ ] , workingDirectoryPath: String ? = nil , environment: [ String : String ] ? = nil ) {
3934 self . launchPath = launchPath
4035 self . arguments = arguments
4136 self . workingDirectoryPath = workingDirectoryPath
4237 self . environment = environment
43- self . standardInput = standardInput
4438 }
4539
4640 /// A GCD group which to wait completion
@@ -389,11 +383,15 @@ extension Signal where Value: TaskEventType {
389383 }
390384}
391385
392- /// Launches a new shell task, using the parameters from `taskDescription`.
386+ /// Launches a new shell task.
387+ ///
388+ /// taskDescription - The task to launch.
389+ /// standardInput - Data to stream to standard input of the launched process. If nil, stdin will
390+ /// be inherited from the parent process.
393391///
394392/// Returns a producer that will launch the task when started, then send
395393/// `TaskEvent`s as execution proceeds.
396- public func launchTask( taskDescription: Task ) -> SignalProducer < TaskEvent < NSData > , TaskError > {
394+ public func launchTask( taskDescription: Task , standardInput : SignalProducer < NSData , NoError > ? = nil ) -> SignalProducer < TaskEvent < NSData > , TaskError > {
397395 return SignalProducer { observer, disposable in
398396 let queue = dispatch_queue_create ( taskDescription. description, DISPATCH_QUEUE_SERIAL)
399397 let group = Task . group
@@ -412,7 +410,7 @@ public func launchTask(taskDescription: Task) -> SignalProducer<TaskEvent<NSData
412410
413411 var stdinProducer : SignalProducer < ( ) , TaskError > = . empty
414412
415- if let input = taskDescription . standardInput {
413+ if let input = standardInput {
416414 switch Pipe . create ( queue, group) {
417415 case let . Success( pipe) :
418416 task. standardInput = pipe. readHandle
0 commit comments