Add autocomplete to bitcoin-qt's console window.

Removed externs
Added listCommands() to CRPCTable

Move autocomplete init to RPCConsole::setClientModel()
This commit is contained in:
Luv Khemani
2016-02-27 11:57:12 +08:00
parent 0fa88ef784
commit ce7413fcb7
4 changed files with 33 additions and 1 deletions

View File

@@ -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";