Windows app (not headless): Inform the user of bad command line parameters, but proceed.

This commit is contained in:
Henrik Rydgård committed 2026-11-04 18:07:29 +01:00
1 parent 3ca6ab6a79
commit b5f91caae4
1 file changed
+11
+11
View File
@@ -557,6 +557,17 @@ CommandLineParseResult CommandLineOptions::Parse(int argc, const char *argv[], C
}
} else if (startsWith(argv[i], "--")) {
PRINT_STDERR("Error: Unknown parameter: %s\n", argv[i]);
if (mode == CmdLineMode::Application) {
// Ignore bad parameters - but inform the user in the Windows debug output at least.
OutputDebugStringUTF8("Warning: Unknown parameter: ");
OutputDebugStringUTF8(argv[i]);
OutputDebugStringUTF8("\n");
std::string msg = StringFromFormat("Unknown command line parameter: %s\n\nProceeding anyway.", argv[i]);
ShowMessageDialog("Unknown Parameter", msg.c_str(), true);
return CommandLineParseResult::Continue;
}
return CommandLineParseResult::Error;
}
// To the next argument.