All pastes #1911586 Raw Edit

bitcoin extended help

public diff v1 · immutable
#1911586 ·published 2010-07-30 06:21 UTC
rendered paste body
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";         }