diff --git a/CommandLineTool/main.swift b/CommandLineTool/main.swift index 39512256..a950f3fd 100644 --- a/CommandLineTool/main.swift +++ b/CommandLineTool/main.swift @@ -69,6 +69,8 @@ CLI.print = { message, type in case .warning: print(stderrIsTTY ? message.inYellow : message, to: &stderr) case .content: + print(message) + case .raw: print(message, terminator: "") } } diff --git a/Sources/CommandLine.swift b/Sources/CommandLine.swift index 55e26b77..59795d54 100644 --- a/Sources/CommandLine.swift +++ b/Sources/CommandLine.swift @@ -40,6 +40,7 @@ public struct CLI { case error case warning case content + case raw } /// Output handler - override this to intercept output from the CLI @@ -506,7 +507,7 @@ func processArguments(_ args: [String], in directory: String) -> ExitCode { } else { // Write to stdout let output = try format(input, options: options, verbose: false) - print(output, as: .content) + print(output, as: .raw) } } catch { fatalError = error