aboutsummaryrefslogtreecommitdiff
path: root/source/Interpreter/OptionValueBoolean.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Interpreter/OptionValueBoolean.cpp')
-rw-r--r--source/Interpreter/OptionValueBoolean.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/source/Interpreter/OptionValueBoolean.cpp b/source/Interpreter/OptionValueBoolean.cpp
index 8be8220fb306..6f893a94e863 100644
--- a/source/Interpreter/OptionValueBoolean.cpp
+++ b/source/Interpreter/OptionValueBoolean.cpp
@@ -71,21 +71,17 @@ lldb::OptionValueSP OptionValueBoolean::DeepCopy() const {
return OptionValueSP(new OptionValueBoolean(*this));
}
-size_t OptionValueBoolean::AutoComplete(CommandInterpreter &interpreter,
- CompletionRequest &request) {
- request.SetWordComplete(false);
- static const llvm::StringRef g_autocomplete_entries[] = {
- "true", "false", "on", "off", "yes", "no", "1", "0"};
+void OptionValueBoolean::AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request) {
+ llvm::StringRef autocomplete_entries[] = {"true", "false", "on", "off",
+ "yes", "no", "1", "0"};
- auto entries = llvm::makeArrayRef(g_autocomplete_entries);
+ auto entries = llvm::makeArrayRef(autocomplete_entries);
// only suggest "true" or "false" by default
if (request.GetCursorArgumentPrefix().empty())
entries = entries.take_front(2);
- for (auto entry : entries) {
- if (entry.startswith_lower(request.GetCursorArgumentPrefix()))
- request.AddCompletion(entry);
- }
- return request.GetNumberOfMatches();
+ for (auto entry : entries)
+ request.TryCompleteCurrentArg(entry);
}