mirror of
https://github.com/nicklockwood/SwiftFormat.git
synced 2026-06-16 10:34:34 +00:00
Fixed missing newlines in CLI output
This commit is contained in:
@@ -69,6 +69,8 @@ CLI.print = { message, type in
|
|||||||
case .warning:
|
case .warning:
|
||||||
print(stderrIsTTY ? message.inYellow : message, to: &stderr)
|
print(stderrIsTTY ? message.inYellow : message, to: &stderr)
|
||||||
case .content:
|
case .content:
|
||||||
|
print(message)
|
||||||
|
case .raw:
|
||||||
print(message, terminator: "")
|
print(message, terminator: "")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ public struct CLI {
|
|||||||
case error
|
case error
|
||||||
case warning
|
case warning
|
||||||
case content
|
case content
|
||||||
|
case raw
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Output handler - override this to intercept output from the CLI
|
/// Output handler - override this to intercept output from the CLI
|
||||||
@@ -506,7 +507,7 @@ func processArguments(_ args: [String], in directory: String) -> ExitCode {
|
|||||||
} else {
|
} else {
|
||||||
// Write to stdout
|
// Write to stdout
|
||||||
let output = try format(input, options: options, verbose: false)
|
let output = try format(input, options: options, verbose: false)
|
||||||
print(output, as: .content)
|
print(output, as: .raw)
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
fatalError = error
|
fatalError = error
|
||||||
|
|||||||
Reference in New Issue
Block a user