From 7c3614cc62566a17a8cab961fb80f96185de5879 Mon Sep 17 00:00:00 2001 From: Pat Hartl Date: Mon, 11 May 2026 16:49:40 -0500 Subject: [PATCH 1/2] Allow config path to be set via command line --- src/m_Do/m_Do_main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/m_Do/m_Do_main.cpp b/src/m_Do/m_Do_main.cpp index c93d040081..84372332e1 100644 --- a/src/m_Do/m_Do_main.cpp +++ b/src/m_Do/m_Do_main.cpp @@ -671,6 +671,7 @@ int game_main(int argc, char* argv[]) { ("h,help", "Print usage") ("console", "Show the Windows console window for logs", cxxopts::value()->default_value("false")->implicit_value("true")) ("dvd", "Path to DVD image file", cxxopts::value()) + ("config", "Path to the config directory", cxxopts::value()->default_value(calculate_config_path().string())) ("backend", "Graphics API backend to use (auto, d3d12, metal, vulkan, null)", cxxopts::value()) ("cvar", "Override configuration variables without modifying config", cxxopts::value>()); @@ -691,7 +692,7 @@ int game_main(int argc, char* argv[]) { exit(1); } - dusk::ConfigPath = calculate_config_path(); + dusk::ConfigPath = parsed_arg_options["config"].as(); const auto startupLogLevel = static_cast(parsed_arg_options["log-level"].as()); dusk::InitializeFileLogging(dusk::ConfigPath, startupLogLevel); From a7d7430b7c4065af7b49f01d1c2fd21b57ed1921 Mon Sep 17 00:00:00 2001 From: Pat Hartl Date: Mon, 11 May 2026 17:57:48 -0500 Subject: [PATCH 2/2] Use ternary, parse option as stf::filesystem::path --- src/m_Do/m_Do_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/m_Do/m_Do_main.cpp b/src/m_Do/m_Do_main.cpp index 84372332e1..6b6febbd2b 100644 --- a/src/m_Do/m_Do_main.cpp +++ b/src/m_Do/m_Do_main.cpp @@ -671,7 +671,7 @@ int game_main(int argc, char* argv[]) { ("h,help", "Print usage") ("console", "Show the Windows console window for logs", cxxopts::value()->default_value("false")->implicit_value("true")) ("dvd", "Path to DVD image file", cxxopts::value()) - ("config", "Path to the config directory", cxxopts::value()->default_value(calculate_config_path().string())) + ("config", "Path to the config directory", cxxopts::value()) ("backend", "Graphics API backend to use (auto, d3d12, metal, vulkan, null)", cxxopts::value()) ("cvar", "Override configuration variables without modifying config", cxxopts::value>()); @@ -692,7 +692,7 @@ int game_main(int argc, char* argv[]) { exit(1); } - dusk::ConfigPath = parsed_arg_options["config"].as(); + dusk::ConfigPath = parsed_arg_options.count("config") ? std::filesystem::path(parsed_arg_options["config"].as()) : calculate_config_path(); const auto startupLogLevel = static_cast(parsed_arg_options["log-level"].as()); dusk::InitializeFileLogging(dusk::ConfigPath, startupLogLevel);