diff options
author | Andrew Chow <achow101-github@achow101.com> | 2018-05-16 15:15:18 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2018-05-30 11:09:15 -0400 |
commit | 174f7c80801383cde5ea514b19fb8b108b56b31c (patch) | |
tree | ede8b06838566830fe4b782b7469770a9c066bf0 /src/util.h | |
parent | fd96d54f39cf4f66890e0bb40812d47e69728cec (diff) |
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.
Diffstat (limited to 'src/util.h')
-rw-r--r-- | src/util.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/util.h b/src/util.h index 17dd5c0683..1d318e2851 100644 --- a/src/util.h +++ b/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); |