summaryrefslogtreecommitdiff
path: root/unix/main.c
diff options
context:
space:
mode:
authorDave Hylands <dhylands@gmail.com>2014-05-07 07:15:00 -0700
committerDave Hylands <dhylands@gmail.com>2014-05-07 07:19:51 -0700
commit117c46d9eb00e8ffaabc1002a4946440cb1eb5b0 (patch)
treeb247a7b62a896d2bbf06469a6ee384da3da8f46a /unix/main.c
parent0ef015b2533f7faeede18382c1d1f4eac919244b (diff)
Add input command for unix
Diffstat (limited to 'unix/main.c')
-rw-r--r--unix/main.c31
1 files changed, 1 insertions, 30 deletions
diff --git a/unix/main.c b/unix/main.c
index 5a7ea1c03..cc8081150 100644
--- a/unix/main.c
+++ b/unix/main.c
@@ -49,11 +49,7 @@
#include "repl.h"
#include "gc.h"
#include "genhdr/py-version.h"
-
-#if MICROPY_USE_READLINE
-#include <readline/readline.h>
-#include <readline/history.h>
-#endif
+#include "input.h"
// Command line options, with their defaults
bool compile_only = false;
@@ -143,31 +139,6 @@ STATIC char *strjoin(const char *s1, int sep_char, const char *s2) {
return s;
}
-STATIC char *prompt(char *p) {
-#if MICROPY_USE_READLINE
- char *line = readline(p);
- if (line) {
- add_history(line);
- }
-#else
- static char buf[256];
- fputs(p, stdout);
- char *s = fgets(buf, sizeof(buf), stdin);
- if (!s) {
- return NULL;
- }
- int l = strlen(buf);
- if (buf[l - 1] == '\n') {
- buf[l - 1] = 0;
- } else {
- l++;
- }
- char *line = malloc(l);
- memcpy(line, buf, l);
-#endif
- return line;
-}
-
STATIC void do_repl(void) {
printf("Micro Python " MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE "; UNIX version\n");