From 14d8366d0582b84a89162e96e8fb64369b35c667 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 15 Oct 2014 08:32:46 +0200 Subject: [PATCH] Fix incorrect auto-completion suggestions fixes #7378 --- lib/base/clicommand.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/base/clicommand.cpp b/lib/base/clicommand.cpp index 0dfd358d7..5f31ac524 100644 --- a/lib/base/clicommand.cpp +++ b/lib/base/clicommand.cpp @@ -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; -- 2.40.0