]> granicus.if.org Git - icinga2/commitdiff
Fix incorrect auto-completion suggestions
authorGunnar Beutner <gunnar@beutner.name>
Wed, 15 Oct 2014 06:32:46 +0000 (08:32 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Wed, 15 Oct 2014 06:32:46 +0000 (08:32 +0200)
fixes #7378

lib/base/clicommand.cpp

index 0dfd358d73d7de6312cd8d8cabe8a37cdc5cdb2a..5f31ac524326edcf2c0ccc8d441389f18d7cb06b 100644 (file)
@@ -207,6 +207,9 @@ void CLICommand::ShowCommands(int argc, char **argv, po::options_description *vi
        if (autocomplete) {
                if (autoindex < argc)
                        aword = argv[autoindex];
+
+               if (autoindex - 1 > best_match.size())
+                       return;
        } else
                std::cout << "Supported commands: " << std::endl;