Changeset View
Changeset View
Standalone View
Standalone View
src/util/system.cpp
Show First 20 Lines • Show All 617 Lines • ▼ Show 20 Lines | void ArgsManager::AddArg(const std::string &name, const std::string &help, | ||||
std::map<std::string, Arg> &arg_map = m_available_args[cat]; | std::map<std::string, Arg> &arg_map = m_available_args[cat]; | ||||
auto ret = arg_map.emplace( | auto ret = arg_map.emplace( | ||||
name.substr(0, eq_index), | name.substr(0, eq_index), | ||||
Arg(name.substr(eq_index, name.size() - eq_index), help, debug_only)); | Arg(name.substr(eq_index, name.size() - eq_index), help, debug_only)); | ||||
// Make sure an insertion actually happened. | // Make sure an insertion actually happened. | ||||
assert(ret.second); | assert(ret.second); | ||||
} | } | ||||
void ArgsManager::AddHiddenArgs(const std::vector<std::string> &names) { | |||||
for (const std::string &name : names) { | |||||
AddArg(name, "", false, OptionsCategory::HIDDEN); | |||||
} | |||||
} | |||||
void ArgsManager::ClearArg(const std::string &strArg) { | void ArgsManager::ClearArg(const std::string &strArg) { | ||||
LOCK(cs_args); | LOCK(cs_args); | ||||
m_override_args.erase(strArg); | m_override_args.erase(strArg); | ||||
m_config_args.erase(strArg); | m_config_args.erase(strArg); | ||||
} | } | ||||
std::string ArgsManager::GetHelpMessage() const { | std::string ArgsManager::GetHelpMessage() const { | ||||
const bool show_debug = gArgs.GetBoolArg("-help-debug", false); | const bool show_debug = gArgs.GetBoolArg("-help-debug", false); | ||||
▲ Show 20 Lines • Show All 744 Lines • Show Last 20 Lines |