bitcoin-wallet: use command-specific options
What changed, and why it matters
This is a tiny user-interface cleanup for the bitcoin-wallet command-line tool. It moves the '-dumpfile' option into a 'command-specific' category and declares that it only applies to the 'dump' and 'createfromdump' commands. There is no change to how data is handled, no bug fix, and no security relevance visible in the commit.
No security action needed. Treat as a normal refactoring/help-text change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch changes one OptionsCategory constant and adds command-specific option lists to two AddCommand() calls in src/bitcoin-wallet.cpp. The -dumpfile argument’s category is changed from OPTIONS to COMMAND_OPTIONS, and the ‘dump’/’createfromdump’ commands are annotated as accepting -dumpfile. This is a code-organization/help-text change only; no logic, validation, or file handling is altered.
Changed components
src/bitcoin-wallet.cppbitcoin-wallet command-line tool help/option categorizationInspect captured patch +3 / −3
diff --git a/src/bitcoin-wallet.cpp b/src/bitcoin-wallet.cpp
index 9b0136da..f72d33b0 100644
--- a/src/bitcoin-wallet.cpp
+++ b/src/bitcoin-wallet.cpp
@@ -37,14 +37,14 @@ static void SetupWalletToolArgs(ArgsManager& argsman)
argsman.AddArg("-version", "Print version and exit", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-datadir=<dir>", "Specify data directory", ArgsManager::ALLOW_ANY | ArgsManager::DISALLOW_NEGATION, OptionsCategory::OPTIONS);
argsman.AddArg("-wallet=<wallet-name>", "Specify wallet name", ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::OPTIONS);
- argsman.AddArg("-dumpfile=<file name>", "When used with 'dump', writes out the records to this file. When used with 'createfromdump', loads the records into a new wallet.", ArgsManager::ALLOW_ANY | ArgsManager::DISALLOW_NEGATION, OptionsCategory::OPTIONS);
+ argsman.AddArg("-dumpfile=<file name>", "When used with 'dump', writes out the records to this file. When used with 'createfromdump', loads the records into a new wallet.", ArgsManager::ALLOW_ANY | ArgsManager::DISALLOW_NEGATION, OptionsCategory::COMMAND_OPTIONS);
argsman.AddArg("-debug=<category>", "Output debugging information (default: 0).", 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");
argsman.AddCommand("create", "Create a new descriptor wallet file");
- argsman.AddCommand("dump", "Print out all of the wallet key-value records");
- argsman.AddCommand("createfromdump", "Create new wallet file from dumped records");
+ argsman.AddCommand("dump", "Print out all of the wallet key-value records", {"-dumpfile"});
+ argsman.AddCommand("createfromdump", "Create new wallet file from dumped records", {"-dumpfile"});
}
static std::optional<int> WalletAppInit(ArgsManager& args, int argc, char* argv[])
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.