authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-10-03 03:58:16+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2024-10-03 03:58:16+02:00
logf99097e68fb52d9801e0d933a58ba8e8dd850cc4
tree4f6b8287e4464e56b28bcd5c834d86ca69987f91
parente22d79dacb52468e1602dfb6849c3ab96d846294
parent6319805ad152d44887c64c3bf6886bef36378e19
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #20805 from xdBronch/lang-flag

handle -x language flag without spaces

1 files changed, 5 insertions(+), 2 deletions(-)

src/main.zig+5-2
...@@ -1703,8 +1703,11 @@ fn buildOutputType(...@@ -1703,8 +1703,11 @@ fn buildOutputType(
1703 try cc_argv.append(arena, arg);1703 try cc_argv.append(arena, arg);
1704 } else if (mem.startsWith(u8, arg, "-I")) {1704 } else if (mem.startsWith(u8, arg, "-I")) {
1705 try cssan.addIncludePath(arena, &cc_argv, .I, arg, arg[2..], true);1705 try cssan.addIncludePath(arena, &cc_argv, .I, arg, arg[2..], true);
1706 } else if (mem.eql(u8, arg, "-x")) {1706 } else if (mem.startsWith(u8, arg, "-x")) {
1707 const lang = args_iter.nextOrFatal();1707 const lang = if (arg.len == "-x".len)
1708 args_iter.nextOrFatal()
1709 else
1710 arg["-x".len..];
1708 if (mem.eql(u8, lang, "none")) {1711 if (mem.eql(u8, lang, "none")) {
1709 file_ext = null;1712 file_ext = null;
1710 } else if (Compilation.LangToExt.get(lang)) |got_ext| {1713 } else if (Compilation.LangToExt.get(lang)) |got_ext| {