xinkt
February 29th, 2008, 03:29 PM
Hello,
I'm programming a CLI application and I would like to add the autocompletion feature.
I have all the valid commands in a hash table and I would like to display the available options when a user presses the TAB key when typing an incomplete command.
Ex: sc(hit the TAB key) --> scanf
The same functionality as in a linux shell.
The problem is when I do a (cin >> cmd) I have to press the enter key to read that line and I would like to display the options only by pressing the TAB key.
I tried the ncurses library but I would like to do that with standard C++ w/o any external library.
Somebody with a good idea?
I'm programming a CLI application and I would like to add the autocompletion feature.
I have all the valid commands in a hash table and I would like to display the available options when a user presses the TAB key when typing an incomplete command.
Ex: sc(hit the TAB key) --> scanf
The same functionality as in a linux shell.
The problem is when I do a (cin >> cmd) I have to press the enter key to read that line and I would like to display the options only by pressing the TAB key.
I tried the ncurses library but I would like to do that with standard C++ w/o any external library.
Somebody with a good idea?