Merge of Fredrik Hultin command_line
[people/xl0/gpxe.git] / src / core / cmdline.c
1 #include "cmdline.h"
2 #include "cmdlinelib.h"
3 #include <console.h>
4
5 void cmdl_start()
6 {
7         cmd_line* cmd;
8         
9         cmd = cmdl_create();
10         
11         cmdl_setpropmt(cmd, "?>");
12
13         cmdl_printf(cmd, "Welcome to Etherboot\n\n");
14         
15         while(!cmdl_getexit(cmd)){
16                 int i;
17                 
18                 printf("%s%s %s", cmdl_getoutput(cmd), cmdl_getprompt(cmd), cmdl_getbuffer(cmd));
19                 
20                 cmdl_addchar(cmd, getchar());
21                 
22                 /* TODO HACK temporary clear line */
23                 putchar(0xd);
24                 for(i=0; i < 79; i++){
25                         putchar(0x20);
26                 }
27                 putchar(0xd);
28         }
29         cmdl_free(cmd);
30 }
31