zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit f99097e68fb52d9801e0d933a58ba8e8dd850cc4 (tree)
parent e22d79dacb52468e1602dfb6849c3ab96d846294
Author: Alex Rønne Petersen <alex@alexrp.com>
Date:   Thu,  3 Oct 2024 03:58:16 +0200

Merge pull request #20805 from xdBronch/lang-flag

handle -x language flag without spaces
Diffstat:
Msrc/main.zig | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/main.zig b/src/main.zig @@ -1703,8 +1703,11 @@ fn buildOutputType( try cc_argv.append(arena, arg); } else if (mem.startsWith(u8, arg, "-I")) { try cssan.addIncludePath(arena, &cc_argv, .I, arg, arg[2..], true); - } else if (mem.eql(u8, arg, "-x")) { - const lang = args_iter.nextOrFatal(); + } else if (mem.startsWith(u8, arg, "-x")) { + const lang = if (arg.len == "-x".len) + args_iter.nextOrFatal() + else + arg["-x".len..]; if (mem.eql(u8, lang, "none")) { file_ext = null; } else if (Compilation.LangToExt.get(lang)) |got_ext| {