Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

bitcoin extended help
Friday, July 30th, 2010 at 12:21:22am MDT 

  1. Index: rpc.cpp
  2. ===================================================================
  3. --- rpc.cpp     (revision 119)
  4. +++ rpc.cpp     (working copy)
  5. @@ -56,11 +56,16 @@
  6.  
  7.  Value help(const Array& params, bool fHelp)
  8.  {
  9. -    if (fHelp || params.size() != 0)
  10. +    if (fHelp || params.size() > 1)
  11.          throw runtime_error(
  12. -            "help\n"
  13. +            "help [command]\n"
  14.              "List commands.");
  15.  
  16. +    string strCmd;
  17. +    bool haveCmd = (params.size() > 0);
  18. +    if (haveCmd)
  19. +       strCmd = params[0].get_str();
  20. +
  21.      string strRet;
  22.      set<rpcfn_type> setDone;
  23.      for (map<string, rpcfn_type>::iterator mi = mapCallTable.begin(); mi != mapCallTable.end(); ++mi)
  24. @@ -70,6 +75,9 @@
  25.          if (strMethod == "getamountreceived" ||
  26.              strMethod == "getallreceived")
  27.              continue;
  28. +       if (haveCmd && (strMethod != strCmd))
  29. +           continue;
  30. +
  31.          try
  32.          {
  33.              Array params;
  34. @@ -81,7 +89,7 @@
  35.          {
  36.              // Help text is returned in an exception
  37.              string strHelp = string(e.what());
  38. -            if (strHelp.find('\n') != -1)
  39. +            if (!haveCmd && strHelp.find('\n') != -1)
  40.                  strHelp = strHelp.substr(0, strHelp.find('\n'));
  41.              strRet += strHelp + "\n";
  42.          }

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.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



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.