'help' rpc commands autocomplete
authorAndrew Chow <achow101@gmail.com>
Mon, 2 Dec 2019 09:21:41 +0000 (11:21 +0200)
committerLaser9un <laser9un@gmail.com>
Mon, 2 Dec 2019 09:21:41 +0000 (11:21 +0200)
Adds autocompletion of the commands for when getting the help of a command by using `help <command>`

src/qt/rpcconsole.cpp

index ae74ab3..7e6ccd6 100644 (file)
@@ -299,9 +299,12 @@ void RPCConsole::setClientModel(ClientModel *model)
         for (size_t i = 0; i < commandList.size(); ++i)
         {
             wordList << commandList[i].c_str();
+            wordList << ("help " + commandList[i]).c_str();
         }
 
+        wordList.sort();
         autoCompleter = new QCompleter(wordList, this);
+        autoCompleter->setModelSorting(QCompleter::CaseSensitivelySortedModel);
         // ui->lineEdit is initially disabled because running commands is only
         // possible from now on.
         ui->lineEdit->setEnabled(true);