aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectHelp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Commands/CommandObjectHelp.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectHelp.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/lldb/source/Commands/CommandObjectHelp.cpp b/lldb/source/Commands/CommandObjectHelp.cpp
index 7d1fdcf..b4a3e01 100644
--- a/lldb/source/Commands/CommandObjectHelp.cpp
+++ b/lldb/source/Commands/CommandObjectHelp.cpp
@@ -114,26 +114,25 @@ bool CommandObjectHelp::DoExecute(Args &command, CommandReturnObject &result) {
bool all_okay = true;
CommandObject *sub_cmd_obj = cmd_obj;
// Loop down through sub_command dictionaries until we find the command
- // object that corresponds
- // to the help command entered.
+ // object that corresponds to the help command entered.
std::string sub_command;
- for (size_t i = 1; i < argc && all_okay; ++i) {
- sub_command = command.GetArgumentAtIndex(i);
+ for (auto &entry : command.entries().drop_front()) {
+ sub_command = entry.ref;
matches.Clear();
if (sub_cmd_obj->IsAlias())
sub_cmd_obj =
((CommandAlias *)sub_cmd_obj)->GetUnderlyingCommand().get();
if (!sub_cmd_obj->IsMultiwordObject()) {
all_okay = false;
+ break;
} else {
CommandObject *found_cmd;
found_cmd =
sub_cmd_obj->GetSubcommandObject(sub_command.c_str(), &matches);
- if (found_cmd == nullptr)
+ if (found_cmd == nullptr || matches.GetSize() > 1) {
all_okay = false;
- else if (matches.GetSize() > 1)
- all_okay = false;
- else
+ break;
+ } else
sub_cmd_obj = found_cmd;
}
}