aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index 186245c94a..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);
@@ -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;