aboutsummaryrefslogtreecommitdiff
path: root/src/common/args.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/args.cpp')
-rw-r--r--src/common/args.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/common/args.cpp b/src/common/args.cpp
index a37a16b62b..f59d2b8f0f 100644
--- a/src/common/args.cpp
+++ b/src/common/args.cpp
@@ -16,6 +16,7 @@
#include <util/fs.h>
#include <util/fs_helpers.h>
#include <util/strencodings.h>
+#include <util/string.h>
#ifdef WIN32
#include <codecvt> /* for codecvt_utf8_utf16 */
@@ -588,6 +589,23 @@ void ArgsManager::AddHiddenArgs(const std::vector<std::string>& names)
}
}
+void ArgsManager::CheckMultipleCLIArgs() const
+{
+ LOCK(cs_args);
+ std::vector<std::string> found{};
+ auto cmds = m_available_args.find(OptionsCategory::CLI_COMMANDS);
+ if (cmds != m_available_args.end()) {
+ for (const auto& [cmd, argspec] : cmds->second) {
+ if (IsArgSet(cmd)) {
+ found.push_back(cmd);
+ }
+ }
+ if (found.size() > 1) {
+ throw std::runtime_error(strprintf("Only one of %s may be specified.", util::Join(found, ", ")));
+ }
+ }
+}
+
std::string ArgsManager::GetHelpMessage() const
{
const bool show_debug = GetBoolArg("-help-debug", false);
@@ -617,6 +635,9 @@ std::string ArgsManager::GetHelpMessage() const
case OptionsCategory::RPC:
usage += HelpMessageGroup("RPC server options:");
break;
+ case OptionsCategory::IPC:
+ usage += HelpMessageGroup("IPC interprocess connection options:");
+ break;
case OptionsCategory::WALLET:
usage += HelpMessageGroup("Wallet options:");
break;
@@ -635,6 +656,9 @@ std::string ArgsManager::GetHelpMessage() const
case OptionsCategory::REGISTER_COMMANDS:
usage += HelpMessageGroup("Register Commands:");
break;
+ case OptionsCategory::CLI_COMMANDS:
+ usage += HelpMessageGroup("CLI Commands:");
+ break;
default:
break;
}