|
|
@ -178,7 +178,7 @@ vector<unsigned char> ParseHexO(const UniValue& o, string strKey) |
|
|
|
* Note: This interface may still be subject to change. |
|
|
|
* Note: This interface may still be subject to change. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
std::string CRPCTable::help(const std::string& strCommand) const |
|
|
|
std::string CRPCTable::help(const std::string& strCommand, const JSONRPCRequest& helpreq) const |
|
|
|
{ |
|
|
|
{ |
|
|
|
string strRet; |
|
|
|
string strRet; |
|
|
|
string category; |
|
|
|
string category; |
|
|
@ -189,6 +189,10 @@ std::string CRPCTable::help(const std::string& strCommand) const |
|
|
|
vCommands.push_back(make_pair(mi->second->category + mi->first, mi->second)); |
|
|
|
vCommands.push_back(make_pair(mi->second->category + mi->first, mi->second)); |
|
|
|
sort(vCommands.begin(), vCommands.end()); |
|
|
|
sort(vCommands.begin(), vCommands.end()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONRPCRequest jreq(helpreq); |
|
|
|
|
|
|
|
jreq.fHelp = true; |
|
|
|
|
|
|
|
jreq.params = UniValue(); |
|
|
|
|
|
|
|
|
|
|
|
BOOST_FOREACH(const PAIRTYPE(string, const CRPCCommand*)& command, vCommands) |
|
|
|
BOOST_FOREACH(const PAIRTYPE(string, const CRPCCommand*)& command, vCommands) |
|
|
|
{ |
|
|
|
{ |
|
|
|
const CRPCCommand *pcmd = command.second; |
|
|
|
const CRPCCommand *pcmd = command.second; |
|
|
@ -198,10 +202,9 @@ std::string CRPCTable::help(const std::string& strCommand) const |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
if ((strCommand != "" || pcmd->category == "hidden") && strMethod != strCommand) |
|
|
|
if ((strCommand != "" || pcmd->category == "hidden") && strMethod != strCommand) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
|
|
|
|
jreq.strMethod = strMethod; |
|
|
|
try |
|
|
|
try |
|
|
|
{ |
|
|
|
{ |
|
|
|
JSONRPCRequest jreq; |
|
|
|
|
|
|
|
jreq.fHelp = true; |
|
|
|
|
|
|
|
rpcfn_type pfn = pcmd->actor; |
|
|
|
rpcfn_type pfn = pcmd->actor; |
|
|
|
if (setDone.insert(pfn).second) |
|
|
|
if (setDone.insert(pfn).second) |
|
|
|
(*pfn)(jreq); |
|
|
|
(*pfn)(jreq); |
|
|
@ -250,7 +253,7 @@ UniValue help(const JSONRPCRequest& jsonRequest) |
|
|
|
if (jsonRequest.params.size() > 0) |
|
|
|
if (jsonRequest.params.size() > 0) |
|
|
|
strCommand = jsonRequest.params[0].get_str(); |
|
|
|
strCommand = jsonRequest.params[0].get_str(); |
|
|
|
|
|
|
|
|
|
|
|
return tableRPC.help(strCommand); |
|
|
|
return tableRPC.help(strCommand, jsonRequest); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|