accept / command line arguments on windows

This commit is contained in:
Ryan Fleury
2024-10-23 11:19:07 -07:00
parent bcd16a4f29
commit 45f5a2d18f
+9 -3
View File
@@ -98,9 +98,10 @@ cmd_line_from_string_list(Arena *arena, String8List command_line)
next = node->next;
String8 option_name = node->string;
// NOTE(rjf): Look at -- or - at the start of an argument to determine if it's
// a flag option. All arguments after a single "--" (with no trailing string
// on the command line will be considered as input files.
// NOTE(rjf): Look at --, -, or / (only on Windows) at the start of an
// argument to determine if it's a flag option. All arguments after a
// single "--" (with no trailing string on the command line will be
// considered as input files.
B32 is_option = 1;
if(after_passthrough_option == 0)
{
@@ -117,6 +118,11 @@ cmd_line_from_string_list(Arena *arena, String8List command_line)
{
option_name = str8_skip(option_name, 1);
}
else if(operating_system_from_context() == OperatingSystem_Windows &&
str8_match(str8_prefix(node->string, 1), str8_lit("/"), 0))
{
option_name = str8_skip(option_name, 1);
}
else
{
is_option = 0;