aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-05-27 15:41:47 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-05-27 20:56:49 -0700
commitb7889f262a5bee642460eb33b1ae7f2b1f87864c (patch)
tree2a159975546426872285a309424494fa6d2476b4 /lib
parentaca7feb8fac2fae8f0b79a2cfac2a248bcd8451b (diff)
downloadzig-b7889f262a5bee642460eb33b1ae7f2b1f87864c.tar.gz
zig-b7889f262a5bee642460eb33b1ae7f2b1f87864c.zip
zig build: respect --color argument
`--color off` now disables the CLI progress bar both in the parent process and the build runner process.
Diffstat (limited to 'lib')
-rw-r--r--lib/compiler/build_runner.zig6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/compiler/build_runner.zig b/lib/compiler/build_runner.zig
index 8aa21df1d9..86ad68133a 100644
--- a/lib/compiler/build_runner.zig
+++ b/lib/compiler/build_runner.zig
@@ -289,7 +289,9 @@ pub fn main() !void {
.windows_api => {},
}
- const main_progress_node = std.Progress.start(.{});
+ const main_progress_node = std.Progress.start(.{
+ .disable_printing = (color == .off),
+ });
builder.debug_log_scopes = debug_log_scopes.items;
builder.resolveInstallPrefix(install_prefix, dir_list);
@@ -1223,7 +1225,7 @@ fn cleanExit() void {
process.exit(0);
}
-const Color = enum { auto, off, on };
+const Color = std.zig.Color;
const Summary = enum { all, new, failures, none };
fn get_tty_conf(color: Color, stderr: File) std.io.tty.Config {