| ... | ... | @@ -82,6 +82,15 @@ pub fn main() !void { |
| 82 | 82 | return usageAndErr(builder, false, stderr_stream); |
| 83 | 83 | }; |
| 84 | 84 | builder.addSearchPrefix(search_prefix); |
| 85 | } else if (mem.eql(u8, arg, "--color")) { |
| 86 | const next_arg = nextArg(args, &arg_idx) orelse { |
| 87 | warn("expected [auto|on|off] after --color", .{}); |
| 88 | return usageAndErr(builder, false, stderr_stream); |
| 89 | }; |
| 90 | builder.color = std.meta.stringToEnum(@TypeOf(builder.color), next_arg) orelse { |
| 91 | warn("expected [auto|on|off] after --color, found '{}'", .{next_arg}); |
| 92 | return usageAndErr(builder, false, stderr_stream); |
| 93 | }; |
| 85 | 94 | } else if (mem.eql(u8, arg, "--override-lib-dir")) { |
| 86 | 95 | builder.override_lib_dir = nextArg(args, &arg_idx) orelse { |
| 87 | 96 | warn("Expected argument after --override-lib-dir\n\n", .{}); |
| ... | ... | @@ -171,6 +180,7 @@ fn usage(builder: *Builder, already_ran_build: bool, out_stream: anytype) !void |
| 171 | 180 | \\ --verbose Print commands before executing them |
| 172 | 181 | \\ --prefix [path] Override default install prefix |
| 173 | 182 | \\ --search-prefix [path] Add a path to look for binaries, libraries, headers |
| 183 | \\ --color [auto|off|on] Enable or disable colored error messages |
| 174 | 184 | \\ |
| 175 | 185 | \\Project-Specific Options: |
| 176 | 186 | \\ |