[Base] Attach console on cvar help/failure.

[Base] Attempt attaching to console on cvar help/failure.
This commit is contained in:
gibbed
2021-06-28 11:27:36 -05:00
committed by Rick Gibbed
parent 80cafd9358
commit 92242f3f7d
4 changed files with 9 additions and 5 deletions

View File

@@ -65,6 +65,7 @@ void ParseLaunchArguments(int& argc, char**& argv,
auto result = options.parse(argc, argv);
if (result.count("help")) {
xe::AttachConsole();
if (xe::has_console_attached()) {
PrintHelpAndExit();
} else {
@@ -88,6 +89,7 @@ void ParseLaunchArguments(int& argc, char**& argv,
}
}
} catch (const cxxopts::OptionException& e) {
xe::AttachConsole();
if (xe::has_console_attached()) {
std::cout << e.what() << std::endl;
PrintHelpAndExit();