summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/CommandInterpreter.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2010-06-24 20:28:42 +0000
committerJim Ingham <jingham@apple.com>2010-06-24 20:28:42 +0000
commit490ac5553626a1a3b526473b9aa619291eacf670 (patch)
tree2cc2f7f743ab2c5e067e072c9e83e3d1076515e7 /lldb/source/Interpreter/CommandInterpreter.cpp
parent9b659142a6548030204d6b1e4a7227014a7c07af (diff)
downloadbcm5719-llvm-490ac5553626a1a3b526473b9aa619291eacf670.tar.gz
bcm5719-llvm-490ac5553626a1a3b526473b9aa619291eacf670.zip
Fix a bug in handling command resolution for non-exact matches. Now we will correctly give help options when there are both aliases & real commands matching the current input string.
llvm-svn: 106782
Diffstat (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp')
-rw-r--r--lldb/source/Interpreter/CommandInterpreter.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index 984711de193..c4abb8da0fe 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -316,13 +316,13 @@ CommandInterpreter::GetCommandSP (const char *cmd_cstr, bool include_aliases, bo
ret_val = pos->second;
}
- if (num_cmd_matches != 1 && include_aliases && HasAliases())
+ if (include_aliases && HasAliases())
{
num_alias_matches = CommandObject::AddNamesMatchingPartialString (m_alias_dict, cmd_cstr, *matches);
}
- if (num_alias_matches == 1)
+ if (num_alias_matches == 1 && num_cmd_matches == 0)
{
cmd.assign(matches->GetStringAtIndex (num_cmd_matches));
pos = m_alias_dict.find(cmd);
@@ -335,12 +335,12 @@ CommandInterpreter::GetCommandSP (const char *cmd_cstr, bool include_aliases, bo
}
}
- if (num_cmd_matches != 1 && num_alias_matches != 1 && HasUserCommands())
+ if (HasUserCommands())
{
num_user_matches = CommandObject::AddNamesMatchingPartialString (m_user_dict, cmd_cstr, *matches);
}
- if (num_user_matches == 1)
+ if (num_user_matches == 1 && num_alias_matches == 0 && num_cmd_matches == 0)
{
cmd.assign (matches->GetStringAtIndex (num_cmd_matches + num_alias_matches));
OpenPOWER on IntegriCloud