MCPcopy Create free account
hub / github.com/ElementsProject/elements / AddArg

Method AddArg

src/util/system.cpp:637–656  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

635}
636
637void ArgsManager::AddArg(const std::string& name, const std::string& help, unsigned int flags, const OptionsCategory& cat)
638{
639 Assert((flags & ArgsManager::COMMAND) == 0); // use AddCommand
640
641 // Split arg name from its help param
642 size_t eq_index = name.find('=');
643 if (eq_index == std::string::npos) {
644 eq_index = name.size();
645 }
646 std::string arg_name = name.substr(0, eq_index);
647
648 LOCK(cs_args);
649 std::map<std::string, Arg>& arg_map = m_available_args[cat];
650 auto ret = arg_map.emplace(arg_name, Arg{name.substr(eq_index, name.size() - eq_index), help, flags});
651 assert(ret.second); // Make sure an insertion actually happened
652
653 if (flags & ArgsManager::NETWORK_ONLY) {
654 m_network_only_args.emplace(arg_name);
655 }
656}
657
658void ArgsManager::AddHiddenArgs(const std::vector<std::string>& names)
659{

Callers 14

SetupBitcoinTxArgsFunction · 0.80
SetupCliArgsFunction · 0.80
SetupBitcoinUtilArgsFunction · 0.80
SetupServerArgsFunction · 0.80
SetupWalletToolArgsFunction · 0.80
AddLoggingArgsFunction · 0.80
AddWalletOptionsMethod · 0.80
BOOST_FIXTURE_TEST_CASEFunction · 0.80
SetupArgsFunction · 0.80
FUZZ_TARGET_INITFunction · 0.80
SetupUIArgsFunction · 0.80

Calls 2

findMethod · 0.80
sizeMethod · 0.45

Tested by 3

BOOST_FIXTURE_TEST_CASEFunction · 0.64
SetupArgsFunction · 0.64
FUZZ_TARGET_INITFunction · 0.64