diff options
Diffstat (limited to 'src/util.h')
-rw-r--r-- | src/util.h | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/util.h b/src/util.h index 2da8023285..17dd5c0683 100644 --- a/src/util.h +++ b/src/util.h @@ -118,6 +118,23 @@ inline bool IsSwitchChar(char c) #endif } +enum class OptionsCategory +{ + OPTIONS, + CONNECTION, + WALLET, + WALLET_DEBUG_TEST, + ZMQ, + DEBUG_TEST, + CHAINPARAMS, + NODE_RELAY, + BLOCK_CREATION, + RPC, + GUI, + COMMANDS, + REGISTER_COMMANDS +}; + class ArgsManager { protected: @@ -128,6 +145,7 @@ protected: 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; void ReadConfigStream(std::istream& stream); @@ -140,7 +158,7 @@ public: void SelectConfigNetwork(const std::string& network); void ParseParameters(int argc, const char*const argv[]); - void ReadConfigFile(const std::string& confPath); + void ReadConfigFiles(); /** * Log warnings for options in m_section_only_args when @@ -229,6 +247,16 @@ public: * @return CBaseChainParams::MAIN by default; raises runtime error if an invalid combination is given. */ std::string GetChainName() const; + + /** + * Add argument + */ + void AddArg(const std::string& name, const std::string& help, const bool debug_only, const OptionsCategory& cat); + + /** + * Get the help string + */ + std::string GetHelpMessage(); }; extern ArgsManager gArgs; |