aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectCommands.cpp
diff options
context:
space:
mode:
authorGongyu Deng <gy_deng@icloud.com>2020-08-11 10:10:08 +0200
committerRaphael Isemann <teemperor@gmail.com>2020-08-11 10:27:04 +0200
commit31fd64ac57a2005c0691b8870e28b4421cf67047 (patch)
tree7cdad984e1bcafc0200e97de85c8e273379f37f3 /lldb/source/Commands/CommandObjectCommands.cpp
parentdf916062c885f9b010f8348c87e9effae06a10c4 (diff)
downloadllvm-31fd64ac57a2005c0691b8870e28b4421cf67047.zip
llvm-31fd64ac57a2005c0691b8870e28b4421cf67047.tar.gz
llvm-31fd64ac57a2005c0691b8870e28b4421cf67047.tar.bz2
[lldb] tab completion for 'command delete/unalias'
Provided dedicated tab completions for `command delete/unalias`. Reviewed By: teemperor Differential Revision: https://reviews.llvm.org/D81128
Diffstat (limited to 'lldb/source/Commands/CommandObjectCommands.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectCommands.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp
index eaf2234..92730b6 100644
--- a/lldb/source/Commands/CommandObjectCommands.cpp
+++ b/lldb/source/Commands/CommandObjectCommands.cpp
@@ -618,6 +618,17 @@ public:
~CommandObjectCommandsUnalias() override = default;
+ void
+ HandleArgumentCompletion(CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override {
+ if (!m_interpreter.HasCommands() || request.GetCursorIndex() != 0)
+ return;
+
+ for (const auto &ent : m_interpreter.GetAliases()) {
+ request.TryCompleteCurrentArg(ent.first, ent.second->GetHelp());
+ }
+ }
+
protected:
bool DoExecute(Args &args, CommandReturnObject &result) override {
CommandObject::CommandMap::iterator pos;
@@ -699,6 +710,18 @@ public:
~CommandObjectCommandsDelete() override = default;
+ void
+ HandleArgumentCompletion(CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override {
+ if (!m_interpreter.HasCommands() || request.GetCursorIndex() != 0)
+ return;
+
+ for (const auto &ent : m_interpreter.GetCommands()) {
+ if (ent.second->IsRemovable())
+ request.TryCompleteCurrentArg(ent.first, ent.second->GetHelp());
+ }
+ }
+
protected:
bool DoExecute(Args &args, CommandReturnObject &result) override {
CommandObject::CommandMap::iterator pos;