From 0e4c3934a02cda80a72a730593ece41c7fa8026a Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Wed, 14 Oct 2020 16:20:20 +0200 Subject: zig fmt: write modified files to stdout not stderr --- src/main.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/main.zig b/src/main.zig index fa523fdb90..8162bc46b6 100644 --- a/src/main.zig +++ b/src/main.zig @@ -2631,8 +2631,8 @@ fn fmtPathFile( if (check_mode) { const anything_changed = try std.zig.render(fmt.gpa, io.null_out_stream, tree); if (anything_changed) { - // TODO this should output to stdout instead of stderr. - std.debug.print("{}\n", .{file_path}); + const stdout = io.getStdOut().writer(); + try stdout.print("{}\n", .{file_path}); fmt.any_error = true; } } else { @@ -2649,8 +2649,8 @@ fn fmtPathFile( try af.file.writeAll(fmt.out_buffer.items); try af.finish(); - // TODO this should output to stdout instead of stderr. - std.debug.print("{}\n", .{file_path}); + const stdout = io.getStdOut().writer(); + try stdout.print("{}\n", .{file_path}); } } -- cgit v1.2.3