- bitcoin extended help
- Friday, July 30th, 2010 at 12:21:22am MDT
- Index: rpc.cpp
- ===================================================================
- --- rpc.cpp (revision 119)
- +++ rpc.cpp (working copy)
- @@ -56,11 +56,16 @@
- Value help(const Array& params, bool fHelp)
- {
- - if (fHelp || params.size() != 0)
- + if (fHelp || params.size() > 1)
- throw runtime_error(
- - "help\n"
- + "help [command]\n"
- "List commands.");
- + string strCmd;
- + bool haveCmd = (params.size() > 0);
- + if (haveCmd)
- + strCmd = params[0].get_str();
- +
- string strRet;
- set<rpcfn_type> setDone;
- for (map<string, rpcfn_type>::iterator mi = mapCallTable.begin(); mi != mapCallTable.end(); ++mi)
- @@ -70,6 +75,9 @@
- if (strMethod == "getamountreceived" ||
- strMethod == "getallreceived")
- continue;
- + if (haveCmd && (strMethod != strCmd))
- + continue;
- +
- try
- {
- Array params;
- @@ -81,7 +89,7 @@
- {
- // Help text is returned in an exception
- string strHelp = string(e.what());
- - if (strHelp.find('\n') != -1)
- + if (!haveCmd && strHelp.find('\n') != -1)
- strHelp = strHelp.substr(0, strHelp.find('\n'));
- strRet += strHelp + "\n";
- }
advertising
Update the Post
Either update this post and resubmit it with changes, or make a new post.
You may also comment on this post.
Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.