commit 3a22ad70354903ccde2e7274c97e5393ef32d274 (tree)
parent bf588f67d8c6261105f81fd468c420d662541d2a
Author: Aikawa Yataro <aikawayataro@protonmail.com>
Date: Sat, 6 Jul 2024 02:05:55 +0000
zig ld: handle -v linker arg
The "-v" argument is the same as "--version", but the linker should
not exit after the version is printed.
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/main.zig b/src/main.zig
@@ -2475,6 +2475,8 @@ fn buildOutputType(
fatal("unable to parse /version '{s}': {s}", .{ arg, @errorName(err) });
};
have_version = true;
+ } else if (mem.eql(u8, arg, "-v")) {
+ try std.io.getStdOut().writeAll("zig ld " ++ build_options.version ++ "\n");
} else if (mem.eql(u8, arg, "--version")) {
try std.io.getStdOut().writeAll("zig ld " ++ build_options.version ++ "\n");
process.exit(0);