I am trying to add autocomplete functionality to my command line application. So far all the answers are saying that it is priority of the shell but in my case it is different. My program goes into a loop (to get commands) in main()
, so I don't think it has anything to do with shell. How can I achieve such goal?
This following is my program. It starts parsing when the user hits enter (std::getline()
). How can I get user input at runtime without using any external libraries?
while (input != "exit") {
std::cout << "\nCommand >> ";
std::getline(std::cin, input);
com.parse(input);
}