mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-29 13:32:33 +02:00
Remove unused OptionsCategory arg from AddCommand
This commit is contained in:
parent
fa3c1eee7f
commit
fa751a47ff
@ -34,7 +34,7 @@ static void SetupBitcoinUtilArgs(ArgsManager &argsman)
|
|||||||
|
|
||||||
argsman.AddArg("-version", "Print version and exit", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
|
argsman.AddArg("-version", "Print version and exit", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
|
||||||
|
|
||||||
argsman.AddCommand("grind", "Perform proof of work on hex header string", OptionsCategory::COMMANDS);
|
argsman.AddCommand("grind", "Perform proof of work on hex header string");
|
||||||
|
|
||||||
SetupChainParamsBaseOptions(argsman);
|
SetupChainParamsBaseOptions(argsman);
|
||||||
}
|
}
|
||||||
|
@ -33,11 +33,11 @@ static void SetupWalletToolArgs(ArgsManager& argsman)
|
|||||||
argsman.AddArg("-format=<format>", "The format of the wallet file to create. Either \"bdb\" or \"sqlite\". Only used with 'createfromdump'", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
|
argsman.AddArg("-format=<format>", "The format of the wallet file to create. Either \"bdb\" or \"sqlite\". Only used with 'createfromdump'", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
|
||||||
argsman.AddArg("-printtoconsole", "Send trace/debug info to console (default: 1 when no -debug is true, 0 otherwise).", ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
|
argsman.AddArg("-printtoconsole", "Send trace/debug info to console (default: 1 when no -debug is true, 0 otherwise).", ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
|
||||||
|
|
||||||
argsman.AddCommand("info", "Get wallet info", OptionsCategory::COMMANDS);
|
argsman.AddCommand("info", "Get wallet info");
|
||||||
argsman.AddCommand("create", "Create new wallet file", OptionsCategory::COMMANDS);
|
argsman.AddCommand("create", "Create new wallet file");
|
||||||
argsman.AddCommand("salvage", "Attempt to recover private keys from a corrupt wallet. Warning: 'salvage' is experimental.", OptionsCategory::COMMANDS);
|
argsman.AddCommand("salvage", "Attempt to recover private keys from a corrupt wallet. Warning: 'salvage' is experimental.");
|
||||||
argsman.AddCommand("dump", "Print out all of the wallet key-value records", OptionsCategory::COMMANDS);
|
argsman.AddCommand("dump", "Print out all of the wallet key-value records");
|
||||||
argsman.AddCommand("createfromdump", "Create new wallet file from dumped records", OptionsCategory::COMMANDS);
|
argsman.AddCommand("createfromdump", "Create new wallet file from dumped records");
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool WalletAppInit(ArgsManager& args, int argc, char* argv[])
|
static bool WalletAppInit(ArgsManager& args, int argc, char* argv[])
|
||||||
|
@ -620,14 +620,14 @@ void ArgsManager::ForceSetArg(const std::string& strArg, const std::string& strV
|
|||||||
m_settings.forced_settings[SettingName(strArg)] = strValue;
|
m_settings.forced_settings[SettingName(strArg)] = strValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArgsManager::AddCommand(const std::string& cmd, const std::string& help, const OptionsCategory& cat)
|
void ArgsManager::AddCommand(const std::string& cmd, const std::string& help)
|
||||||
{
|
{
|
||||||
Assert(cmd.find('=') == std::string::npos);
|
Assert(cmd.find('=') == std::string::npos);
|
||||||
Assert(cmd.at(0) != '-');
|
Assert(cmd.at(0) != '-');
|
||||||
|
|
||||||
LOCK(cs_args);
|
LOCK(cs_args);
|
||||||
m_accept_any_command = false; // latch to false
|
m_accept_any_command = false; // latch to false
|
||||||
std::map<std::string, Arg>& arg_map = m_available_args[cat];
|
std::map<std::string, Arg>& arg_map = m_available_args[OptionsCategory::COMMANDS];
|
||||||
auto ret = arg_map.emplace(cmd, Arg{"", help, ArgsManager::COMMAND});
|
auto ret = arg_map.emplace(cmd, Arg{"", help, ArgsManager::COMMAND});
|
||||||
Assert(ret.second); // Fail on duplicate commands
|
Assert(ret.second); // Fail on duplicate commands
|
||||||
}
|
}
|
||||||
|
@ -374,7 +374,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Add subcommand
|
* Add subcommand
|
||||||
*/
|
*/
|
||||||
void AddCommand(const std::string& cmd, const std::string& help, const OptionsCategory& cat);
|
void AddCommand(const std::string& cmd, const std::string& help);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add many hidden arguments
|
* Add many hidden arguments
|
||||||
|
Loading…
Reference in New Issue
Block a user