diff options
Diffstat (limited to 'frontend/cli.cpp')
-rw-r--r-- | frontend/cli.cpp | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/frontend/cli.cpp b/frontend/cli.cpp deleted file mode 100644 index de78bc1..0000000 --- a/frontend/cli.cpp +++ /dev/null @@ -1,38 +0,0 @@ -#include <cstdlib> -#include <cstdio> - -#include <readline/readline.h> -#include <readline/history.h> - -#include "cli.h" -#include "frontend/print.h" -#include "strings.h" -#include "cmd.h" - -using namespace std; - -string cli_readline() { - const char * PROMPT = "> "; - - char * input = readline(PROMPT); - SessionLog::get().append(PROMPT); - if (input == NULL) exit(EXIT_SUCCESS); // ctrl-d - string out = string(input); - if (out.size() > 0) add_history(input); - free(input); - - SessionLog::get().append(out); - SessionLog::get().append("\n"); - - return out; -} - -void cli_main() { - while (1) { - string line = cli_readline(); - if (line.length() == 0) continue; - vector<string> argv = split_string(line, " "); - cmd_handle(argv); - } -} - |