mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
Use a struct for arguments and nested map for categories
Instead of a single map with the category and name as the key, make m_available_args contain maps. The key will be the category and the value is a map which actually contains the arguments for that category. The nested map's key is the argument name, while the value is a struct that contains the help text and whether the argument is a debug only argument.
This commit is contained in:
11
src/util.h
11
src/util.h
@@ -140,12 +140,21 @@ class ArgsManager
|
||||
protected:
|
||||
friend class ArgsManagerHelper;
|
||||
|
||||
struct Arg
|
||||
{
|
||||
std::string m_help_param;
|
||||
std::string m_help_text;
|
||||
bool m_debug_only;
|
||||
|
||||
Arg(const std::string& help_param, const std::string& help_text, bool debug_only) : m_help_param(help_param), m_help_text(help_text), m_debug_only(debug_only) {};
|
||||
};
|
||||
|
||||
mutable CCriticalSection cs_args;
|
||||
std::map<std::string, std::vector<std::string>> m_override_args;
|
||||
std::map<std::string, std::vector<std::string>> m_config_args;
|
||||
std::string m_network;
|
||||
std::set<std::string> m_network_only_args;
|
||||
std::map<std::pair<OptionsCategory, std::string>, std::pair<std::string, bool>> m_available_args;
|
||||
std::map<OptionsCategory, std::map<std::string, Arg>> m_available_args;
|
||||
|
||||
void ReadConfigStream(std::istream& stream);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user