understanding rl auto complete

This commit is contained in:
Eliot Horowitz
2010-06-04 15:35:51 -04:00
parent 4991e2804b
commit 13d410ce1b

View File

@@ -44,6 +44,12 @@ bool inMultiLine = 0;
#define CTRLC_HANDLE
#endif
static char** my_completion(const char* text , int start ,int end ){
cout << "YO [" << text << "] " << start << " " << end << endl;
return 0;
}
void shellHistoryInit(){
#ifdef USE_READLINE
stringstream ss;
@@ -56,6 +62,9 @@ void shellHistoryInit(){
using_history();
read_history( historyFile.c_str() );
// TODO: do auto-completion
//rl_attempted_completion_function = my_completion;
#else
cout << "type \"exit\" to exit" << endl;
#endif