0001    //
0002    //  ShortHandRunner.swift
0003    //  ShortHandRunner
0004    
0005    //
0006    //  Created by Omar Abdelhafith on 05/11/2015.
0007    //  Copyright © 2015 Omar Abdelhafith. All rights reserved.
0008    //
0009    
0010    
0011    /**
0012     Executes a command and captures its output
0013     
0014     - parameter command: the command to execute
0015     - parameter args:    the parameters to pass to the command
0016     
0017     - returns: RunResults describing the command results
0018     */
0019    public func run
Env.swift:16
    let keyValues = run("env").stdout.componentsSeparatedByString("\n")
(command: String, args: String...) -> RunResults { 0020 return 🏃.run(command, args: args as [String]) 0021 } 0022 0023 0024 /** 0025 Executes a command and captures its output 0026 0027 - parameter command: the command to execute 0028 - parameter args: the parameters to pass to the command 0029 0030 - returns: RunResults describing the command results 0031 */ 0032 public func run(command: String, args: [String]) -> RunResults { 0033 return 🏃.run(command, args: args) 0034 } 0035 0036 0037 /** 0038 Executes a command and captures its output 0039 0040 - parameter command: the command to execute 0041 - parameter settingsBlock: block that receives the settings to costumize the behavior of run 0042 0043 - returns: RunResults describing the command results 0044 */ 0045 public func run(command: String, settingsBlock: (RunSettings -> Void)) -> RunResults { 0046 return 🏃.run(command, settings: settingsBlock) 0047 } 0048 0049 0050 /** 0051 Executes a command and captures its output 0052 0053 - parameter command: the command to execute 0054 - parameter args: the parameters to pass to the command 0055 - parameter settingsBlock: block that receives the settings to costumize the behavior of run 0056 0057 - returns: RunResults describing the command results 0058 */ 0059 public func run(command: String, args: [String], settings: (RunSettings -> Void)) -> RunResults { 0060 return 🏃.run(command, args: args, settings: settings) 0061 } 0062 0063 0064 /** 0065 Executes a command and captures its output 0066 0067 - parameter command: the command to execute 0068 - parameter echo: echo settings that describe what parts of the command to print 0069 0070 - returns: RunResults describing the command results 0071 */ 0072 func run(command: String, echo: EchoSettings) -> RunResults { 0073 return 🏃.run(command, echo: echo) 0074 } 0075 0076 /** 0077 Execute a command in interactive mode, output won't be captured 0078 0079 - parameter command: the command to execute 0080 0081 - returns: executed command exit code 0082 */ 0083 public func runWithoutCapture(command: String) -> Int { 0084 return 🏃.runWithoutCapture(command) 0085 }