diff options
Diffstat (limited to 'src/util/system.cpp')
-rw-r--r-- | src/util/system.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/util/system.cpp b/src/util/system.cpp index 5f30136fa2..0d8b669b79 100644 --- a/src/util/system.cpp +++ b/src/util/system.cpp @@ -336,15 +336,16 @@ bool ArgsManager::ParseParameters(int argc, const char* const argv[], std::strin m_settings.command_line_options[key].push_back(value); } - // we do not allow -includeconf from command line - bool success = true; + // we do not allow -includeconf from command line, only -noincludeconf if (auto* includes = util::FindKey(m_settings.command_line_options, "includeconf")) { - for (const auto& include : util::SettingsSpan(*includes)) { - error += "-includeconf cannot be used from commandline; -includeconf=" + include.get_str() + "\n"; - success = false; + const util::SettingsSpan values{*includes}; + // Range may be empty if -noincludeconf was passed + if (!values.empty()) { + error = "-includeconf cannot be used from commandline; -includeconf=" + values.begin()->write(); + return false; // pick first value as example } } - return success; + return true; } Optional<unsigned int> ArgsManager::GetArgFlags(const std::string& name) const |