diff options
author | Jim Ingham <jingham@apple.com> | 2010-06-30 05:02:46 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2010-06-30 05:02:46 +0000 |
commit | 558ce124eb9787beae314effe12b3c17568625e1 (patch) | |
tree | 99a0ea792b6a91576c1e4e1e4b97202e2a54963e /lldb/source/Commands/CommandObjectFile.cpp | |
parent | e82689fea2a5f049ac3cfab705e6fac7ce1f0f21 (diff) | |
download | bcm5719-llvm-558ce124eb9787beae314effe12b3c17568625e1.tar.gz bcm5719-llvm-558ce124eb9787beae314effe12b3c17568625e1.zip |
Add a source file completer to the CommandCompleters.
Add a way for the completers to say whether the completed argument should have a space inserted after is
or not.
Added the file name completer to the "file" command.
llvm-svn: 107247
Diffstat (limited to 'lldb/source/Commands/CommandObjectFile.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectFile.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lldb/source/Commands/CommandObjectFile.cpp b/lldb/source/Commands/CommandObjectFile.cpp index bdaf67cc814..2700e2075ec 100644 --- a/lldb/source/Commands/CommandObjectFile.cpp +++ b/lldb/source/Commands/CommandObjectFile.cpp @@ -19,6 +19,7 @@ #include "lldb/Core/Debugger.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandReturnObject.h" +#include "lldb/Interpreter/CommandCompletions.h" #include "lldb/Target/Process.h" using namespace lldb; @@ -166,3 +167,29 @@ CommandObjectFile::Execute return result.Succeeded(); } + +int +CommandObjectFile::HandleArgumentCompletion (CommandInterpreter &interpreter, + Args &input, + int &cursor_index, + int &cursor_char_position, + OptionElementVector &opt_element_vector, + int match_start_point, + int max_return_elements, + bool &word_complete, + StringList &matches) +{ + std::string completion_str (input.GetArgumentAtIndex(cursor_index)); + completion_str.erase (cursor_char_position); + + CommandCompletions::InvokeCommonCompletionCallbacks (interpreter, + CommandCompletions::eDiskFileCompletion, + completion_str.c_str(), + match_start_point, + max_return_elements, + NULL, + word_complete, + matches); + return matches.GetSize(); + +}
\ No newline at end of file |