Skip to content

Commit fa751a4

Browse files
author
MarcoFalke
committed
Remove unused OptionsCategory arg from AddCommand
1 parent fa3c1ee commit fa751a4

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/bitcoin-util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static void SetupBitcoinUtilArgs(ArgsManager &argsman)
3434

3535
argsman.AddArg("-version", "Print version and exit", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
3636

37-
argsman.AddCommand("grind", "Perform proof of work on hex header string", OptionsCategory::COMMANDS);
37+
argsman.AddCommand("grind", "Perform proof of work on hex header string");
3838

3939
SetupChainParamsBaseOptions(argsman);
4040
}

src/bitcoin-wallet.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ static void SetupWalletToolArgs(ArgsManager& argsman)
3333
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);
3434
argsman.AddArg("-printtoconsole", "Send trace/debug info to console (default: 1 when no -debug is true, 0 otherwise).", ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
3535

36-
argsman.AddCommand("info", "Get wallet info", OptionsCategory::COMMANDS);
37-
argsman.AddCommand("create", "Create new wallet file", OptionsCategory::COMMANDS);
38-
argsman.AddCommand("salvage", "Attempt to recover private keys from a corrupt wallet. Warning: 'salvage' is experimental.", OptionsCategory::COMMANDS);
39-
argsman.AddCommand("dump", "Print out all of the wallet key-value records", OptionsCategory::COMMANDS);
40-
argsman.AddCommand("createfromdump", "Create new wallet file from dumped records", OptionsCategory::COMMANDS);
36+
argsman.AddCommand("info", "Get wallet info");
37+
argsman.AddCommand("create", "Create new wallet file");
38+
argsman.AddCommand("salvage", "Attempt to recover private keys from a corrupt wallet. Warning: 'salvage' is experimental.");
39+
argsman.AddCommand("dump", "Print out all of the wallet key-value records");
40+
argsman.AddCommand("createfromdump", "Create new wallet file from dumped records");
4141
}
4242

4343
static bool WalletAppInit(ArgsManager& args, int argc, char* argv[])

src/util/system.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,14 +620,14 @@ void ArgsManager::ForceSetArg(const std::string& strArg, const std::string& strV
620620
m_settings.forced_settings[SettingName(strArg)] = strValue;
621621
}
622622

623-
void ArgsManager::AddCommand(const std::string& cmd, const std::string& help, const OptionsCategory& cat)
623+
void ArgsManager::AddCommand(const std::string& cmd, const std::string& help)
624624
{
625625
Assert(cmd.find('=') == std::string::npos);
626626
Assert(cmd.at(0) != '-');
627627

628628
LOCK(cs_args);
629629
m_accept_any_command = false; // latch to false
630-
std::map<std::string, Arg>& arg_map = m_available_args[cat];
630+
std::map<std::string, Arg>& arg_map = m_available_args[OptionsCategory::COMMANDS];
631631
auto ret = arg_map.emplace(cmd, Arg{"", help, ArgsManager::COMMAND});
632632
Assert(ret.second); // Fail on duplicate commands
633633
}

src/util/system.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ class ArgsManager
374374
/**
375375
* Add subcommand
376376
*/
377-
void AddCommand(const std::string& cmd, const std::string& help, const OptionsCategory& cat);
377+
void AddCommand(const std::string& cmd, const std::string& help);
378378

379379
/**
380380
* Add many hidden arguments

0 commit comments

Comments
 (0)