aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Interpreter/CommandObjectRegexCommand.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Interpreter/CommandObjectRegexCommand.cpp')
-rw-r--r--lldb/source/Interpreter/CommandObjectRegexCommand.cpp36
1 files changed, 34 insertions, 2 deletions
diff --git a/lldb/source/Interpreter/CommandObjectRegexCommand.cpp b/lldb/source/Interpreter/CommandObjectRegexCommand.cpp
index 05d6e09..25b02ba 100644
--- a/lldb/source/Interpreter/CommandObjectRegexCommand.cpp
+++ b/lldb/source/Interpreter/CommandObjectRegexCommand.cpp
@@ -30,11 +30,13 @@ CommandObjectRegexCommand::CommandObjectRegexCommand
const char *name,
const char *help,
const char *syntax,
- uint32_t max_matches
+ uint32_t max_matches,
+ uint32_t completion_type_mask
) :
CommandObjectRaw (interpreter, name, help, syntax),
m_max_matches (max_matches),
- m_entries ()
+ m_entries (),
+ m_completion_type_mask (completion_type_mask)
{
}
@@ -114,3 +116,33 @@ CommandObjectRegexCommand::AddRegexCommand (const char *re_cstr, const char *com
m_entries.pop_back();
return false;
}
+
+int
+CommandObjectRegexCommand::HandleCompletion (Args &input,
+ int &cursor_index,
+ int &cursor_char_position,
+ int match_start_point,
+ int max_return_elements,
+ bool &word_complete,
+ StringList &matches)
+{
+ if (m_completion_type_mask)
+ {
+ std::string completion_str (input.GetArgumentAtIndex (cursor_index), cursor_char_position);
+ CommandCompletions::InvokeCommonCompletionCallbacks (m_interpreter,
+ m_completion_type_mask,
+ completion_str.c_str(),
+ match_start_point,
+ max_return_elements,
+ NULL,
+ word_complete,
+ matches);
+ return matches.GetSize();
+ }
+ else
+ {
+ matches.Clear();
+ word_complete = false;
+ }
+ return 0;
+}