We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f56c92d commit a3c79b4Copy full SHA for a3c79b4
Sources/POSIX/misc.swift
@@ -11,15 +11,8 @@
11
/**
12
For an array of String arguments that would be passed to system() or
13
popen(), returns a pretty-printed string that is user-readable and
14
- could be typed into a Terminal to reattempt execution.
+ could be typed into a Terminal to re-attempt execution.
15
*/
16
public func prettyArguments(args: [String]) -> String {
17
- return args.map { arg in
18
- let chars = arg.characters
19
- if chars.contains(" ") {
20
- return chars.split(" ").map(String.init).joinWithSeparator("\\ ")
21
- } else {
22
- return arg
23
- }
24
- }.joinWithSeparator(" ")
+ return args.map { $0.characters.split(" ").map(String.init).joinWithSeparator("\\ ") }.joinWithSeparator(" ")
25
}
0 commit comments