aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/server.cpp
diff options
context:
space:
mode:
authorLuv Khemani <luvb@hotmail.com>2016-02-27 11:57:12 +0800
committerLuv Khemani <luvb@hotmail.com>2016-03-12 13:04:23 +0800
commitce7413fcb7d28bd72e5ade7dc9756504de766fc2 (patch)
tree0b5fe6bab7c5914b2efc729d86e0a458822c169d /src/rpc/server.cpp
parent0fa88ef784dda77422fdb20b7358803f9b30a5c1 (diff)
Add autocomplete to bitcoin-qt's console window.
Removed externs Added listCommands() to CRPCTable Move autocomplete init to RPCConsole::setClientModel()
Diffstat (limited to 'src/rpc/server.cpp')
-rw-r--r--src/rpc/server.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp
index b2d4559ccd..e6fae263bf 100644
--- a/src/rpc/server.cpp
+++ b/src/rpc/server.cpp
@@ -499,6 +499,17 @@ UniValue CRPCTable::execute(const std::string &strMethod, const UniValue &params
g_rpcSignals.PostCommand(*pcmd);
}
+std::vector<std::string> CRPCTable::listCommands() const
+{
+ std::vector<std::string> commandList;
+ typedef std::map<std::string, const CRPCCommand*> commandMap;
+
+ std::transform( mapCommands.begin(), mapCommands.end(),
+ std::back_inserter(commandList),
+ boost::bind(&commandMap::value_type::first,_1) );
+ return commandList;
+}
+
std::string HelpExampleCli(const std::string& methodname, const std::string& args)
{
return "> bitcoin-cli " + methodname + " " + args + "\n";