summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/CommandInterpreter.cpp
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2013-06-18 18:01:08 +0000
committerEnrico Granata <egranata@apple.com>2013-06-18 18:01:08 +0000
commit5342c4409b9031c26ed0b6b674c4a6e18ab2424b (patch)
tree1fe511b9b6e2ff4a704c1c7fa2fc59d022df3eb1 /lldb/source/Interpreter/CommandInterpreter.cpp
parent1a90f5956d151856f323d0e5d86c032a20320625 (diff)
downloadbcm5719-llvm-5342c4409b9031c26ed0b6b674c4a6e18ab2424b.tar.gz
bcm5719-llvm-5342c4409b9031c26ed0b6b674c4a6e18ab2424b.zip
This patch fixes the issue where our command-line tab completer would sometimes replicate commands
e.g. (lldb) pl<TAB> Available completions: platform plugin platform plugin Thanks to Matthew Sorrels for doing work and testing on this issue llvm-svn: 184212
Diffstat (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp')
-rw-r--r--lldb/source/Interpreter/CommandInterpreter.cpp31
1 files changed, 18 insertions, 13 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index 3dc5d292318..579cec4635e 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -850,24 +850,29 @@ CommandInterpreter::GetCommandObject (const char *cmd_cstr, StringList *matches)
// If we didn't find an exact match to the command string in the commands, look in
// the aliases.
+
+ if (command_obj)
+ return command_obj;
- if (command_obj == NULL)
- {
- command_obj = GetCommandSP (cmd_cstr, true, true, matches).get();
- }
-
- // If there wasn't an exact match among the aliases, look for an inexact match
- // in just the commands.
+ command_obj = GetCommandSP (cmd_cstr, true, true, matches).get();
- if (command_obj == NULL)
- command_obj = GetCommandSP(cmd_cstr, false, false, matches).get();
+ if (command_obj)
+ return command_obj;
+
+ // If there wasn't an exact match then look for an inexact one in just the commands
+ command_obj = GetCommandSP(cmd_cstr, false, false, NULL).get();
// Finally, if there wasn't an inexact match among the commands, look for an inexact
// match in both the commands and aliases.
- if (command_obj == NULL)
- command_obj = GetCommandSP(cmd_cstr, true, false, matches).get();
-
- return command_obj;
+
+ if (command_obj)
+ {
+ if (matches)
+ matches->AppendString(command_obj->GetCommandName());
+ return command_obj;
+ }
+
+ return GetCommandSP(cmd_cstr, true, false, matches).get();
}
bool
OpenPOWER on IntegriCloud