File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -46,17 +46,22 @@ public struct Task {
4646 }
4747}
4848
49- extension Task : CustomStringConvertible {
50- public var description : String {
49+ private extension CollectionType where Generator . Element == String {
50+ func escaped ( ) -> [ String ] {
5151 let whitespaceCharacterSet = NSCharacterSet . whitespaceCharacterSet ( )
52- let arguments = self . arguments . map { argument -> String in
53- if argument . rangeOfCharacterFromSet ( whitespaceCharacterSet) != nil {
54- return " \" \( argument ) \" "
52+ return map { string -> String in
53+ if string . rangeOfCharacterFromSet ( whitespaceCharacterSet) != nil {
54+ return " \" \( string ) \" "
5555 } else {
56- return argument
56+ return string
5757 }
5858 }
59- return " \( launchPath) \( arguments. joinWithSeparator ( " " ) ) "
59+ }
60+ }
61+
62+ extension Task : CustomStringConvertible {
63+ public var description : String {
64+ return " \( launchPath) \( arguments. escaped ( ) . joinWithSeparator ( " " ) ) "
6065 }
6166}
6267
You can’t perform that action at this time.
0 commit comments