Skip to content

Commit

Permalink
bitcoin-cli helpdetail to show full help for all RPCs
Browse files Browse the repository at this point in the history
Prints to stdout a concatenation of full help text as if you had run
help on every RPC. This allows you to search help text when you
can't remember the name of an RPC.
  • Loading branch information
LarryRuane committed Jan 1, 2024
1 parent 4b1196a commit f12ccda
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/rpc/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ std::string CRPCTable::help(const std::string& strCommand, const JSONRPCRequest&
{
const CRPCCommand *pcmd = command.second;
std::string strMethod = pcmd->name;
if ((strCommand != "" || pcmd->category == "hidden") && strMethod != strCommand)
if ((strCommand != "" || pcmd->category == "hidden") && strMethod != strCommand && strCommand != "helpdetail")
continue;
jreq.strMethod = strMethod;
try
Expand All @@ -127,6 +127,9 @@ std::string CRPCTable::help(const std::string& strCommand, const JSONRPCRequest&
strRet += "== " + Capitalize(category) + " ==\n";
}
}
if (strCommand == "helpdetail") {
strRet += "== " + Capitalize(pcmd->category) + " ==\n";
}
strRet += strHelp + "\n";
}
}
Expand Down

0 comments on commit f12ccda

Please sign in to comment.