From 10dbc735fe4e4575821837f00eb173286a1f88ee Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 6 Apr 2017 13:59:11 -0400 Subject: zig build: use -D for options instead of -O because -O is usually optimization level --- std/build.zig | 12 ++++++------ std/special/build_runner.zig | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'std') diff --git a/std/build.zig b/std/build.zig index a3c0286bed..1917d1258b 100644 --- a/std/build.zig +++ b/std/build.zig @@ -268,13 +268,13 @@ pub const Builder = struct { } else if (mem.eql(u8, s, "false")) { return false; } else { - %%io.stderr.printf("Expected -O{} to be a boolean, but received '{}'\n", name, s); + %%io.stderr.printf("Expected -D{} to be a boolean, but received '{}'\n", name, s); self.markInvalidUserInput(); return null; } }, UserValue.List => { - %%io.stderr.printf("Expected -O{} to be a boolean, but received a list.\n", name); + %%io.stderr.printf("Expected -D{} to be a boolean, but received a list.\n", name); self.markInvalidUserInput(); return null; }, @@ -312,7 +312,7 @@ pub const Builder = struct { }); }, UserValue.Flag => { - %%io.stderr.printf("Option '-O{}={}' conflicts with flag '-O{}'.\n", name, value, name); + %%io.stderr.printf("Option '-D{}={}' conflicts with flag '-D{}'.\n", name, value, name); return true; }, } @@ -328,11 +328,11 @@ pub const Builder = struct { })) { switch (prev_value.value) { UserValue.Scalar => |s| { - %%io.stderr.printf("Flag '-O{}' conflicts with option '-O{}={}'.\n", name, name, s); + %%io.stderr.printf("Flag '-D{}' conflicts with option '-D{}={}'.\n", name, name, s); return true; }, UserValue.List => { - %%io.stderr.printf("Flag '-O{}' conflicts with multiple options of the same name.\n", name); + %%io.stderr.printf("Flag '-D{}' conflicts with multiple options of the same name.\n", name); return true; }, UserValue.Flag => {}, @@ -374,7 +374,7 @@ pub const Builder = struct { while (true) { const entry = it.next() ?? break; if (!entry.value.used) { - %%io.stderr.printf("Invalid option: -O{}\n\n", entry.key); + %%io.stderr.printf("Invalid option: -D{}\n\n", entry.key); self.markInvalidUserInput(); } } diff --git a/std/special/build_runner.zig b/std/special/build_runner.zig index 1e6628fa99..5f24bc5924 100644 --- a/std/special/build_runner.zig +++ b/std/special/build_runner.zig @@ -25,10 +25,10 @@ pub fn main() -> %void { var arg_i: usize = 1; while (arg_i < os.args.count(); arg_i += 1) { const arg = os.args.at(arg_i); - if (mem.startsWith(u8, arg, "-O")) { + if (mem.startsWith(u8, arg, "-D")) { const option_contents = arg[2...]; if (option_contents.len == 0) { - %%io.stderr.printf("Expected option name after '-O'\n\n"); + %%io.stderr.printf("Expected option name after '-D'\n\n"); return usage(&builder, maybe_zig_exe, false, &io.stderr); } if (const name_end ?= mem.indexOfScalar(u8, option_contents, '=')) { @@ -95,7 +95,7 @@ fn usage(builder: &Builder, maybe_zig_exe: ?[]const u8, already_ran_build: bool, const allocator = builder.allocator; for (builder.available_options_list.toSliceConst()) |option| { const name = %%fmt.allocPrint(allocator, - " -O{}=({})", option.name, Builder.typeIdName(option.type_id)); + " -D{}=({})", option.name, Builder.typeIdName(option.type_id)); defer allocator.free(name); %%out_stream.printf("{s24} {}\n", name, option.description); } -- cgit v1.2.3