- Allow commadn abbreviations.
This commit is contained in:
Paul Beckingham 2014-06-20 08:43:29 -04:00
parent add6ddcf15
commit de39d1f275

View file

@ -28,6 +28,7 @@
#include <iostream>
#include <cstring>
#include <i18n.h>
#include <text.h>
#ifdef HAVE_READLINE
#include <readline/readline.h>
@ -43,19 +44,22 @@ static int commandLoop ()
// Display prompt, get input.
char *line_read = readline (prompt.c_str ());
if (! line_read)
{
std::cout << "\n";
return 1;
}
// Save history.
if (*line_read)
add_history (line_read);
std::string command (line_read);
free (line_read);
// TODO Dispatch command
// Dispatch command
int status = 0;
if (command == "exit") status = 1;
if (closeEnough ("exit", command, 3)) status = 1;
// TODO diagnostics
// TODO help