aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectHelp.cpp
diff options
context:
space:
mode:
authorRaphael Isemann <teemperor@gmail.com>2019-08-22 09:02:54 +0000
committerRaphael Isemann <teemperor@gmail.com>2019-08-22 09:02:54 +0000
commit1153dc9603c74f85314505abdae28b3f0dc85c39 (patch)
tree4f32ee69f63bdcbfb94470ae767186cdfb6de47d /lldb/source/Commands/CommandObjectHelp.cpp
parent35038c914c187484e65440d204029e716ea1eeca (diff)
downloadllvm-1153dc9603c74f85314505abdae28b3f0dc85c39.zip
llvm-1153dc9603c74f85314505abdae28b3f0dc85c39.tar.gz
llvm-1153dc9603c74f85314505abdae28b3f0dc85c39.tar.bz2
[lldb][NFC] NFC cleanup for the completion code
llvm-svn: 369632
Diffstat (limited to 'lldb/source/Commands/CommandObjectHelp.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectHelp.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/lldb/source/Commands/CommandObjectHelp.cpp b/lldb/source/Commands/CommandObjectHelp.cpp
index 811841f..78e19f73 100644
--- a/lldb/source/Commands/CommandObjectHelp.cpp
+++ b/lldb/source/Commands/CommandObjectHelp.cpp
@@ -205,20 +205,20 @@ void CommandObjectHelp::HandleCompletion(CompletionRequest &request) {
// Return the completions of the commands in the help system:
if (request.GetCursorIndex() == 0) {
m_interpreter.HandleCompletionMatches(request);
- } else {
- CommandObject *cmd_obj =
- m_interpreter.GetCommandObject(request.GetParsedLine()[0].ref);
+ return;
+ }
+ CommandObject *cmd_obj =
+ m_interpreter.GetCommandObject(request.GetParsedLine()[0].ref);
- // The command that they are getting help on might be ambiguous, in which
- // case we should complete that, otherwise complete with the command the
- // user is getting help on...
+ // The command that they are getting help on might be ambiguous, in which
+ // case we should complete that, otherwise complete with the command the
+ // user is getting help on...
- if (cmd_obj) {
- request.GetParsedLine().Shift();
- request.SetCursorIndex(request.GetCursorIndex() - 1);
- cmd_obj->HandleCompletion(request);
- } else {
- m_interpreter.HandleCompletionMatches(request);
- }
+ if (cmd_obj) {
+ request.GetParsedLine().Shift();
+ request.SetCursorIndex(request.GetCursorIndex() - 1);
+ cmd_obj->HandleCompletion(request);
+ return;
}
+ m_interpreter.HandleCompletionMatches(request);
}