cmdline-examples: remove basic_char_loop() and use cmdline_interact()
[libcmdline.git] / src / genconf / main.c
index 3748710..95d0b78 100644 (file)
@@ -59,22 +59,6 @@ struct cmdline *cl;
 
 /*** main */
 
-void basic_char_loop(void)
-{
-       char c;
-
-       c = -1;
-       /* XXX */
-       while (1) {
-               read(cl->s_in, &c, 1);
-               if (cmdline_in(cl, &c, 1) < 0) {
-                       break;
-               }
-       }
-       cmdline_free(cl);
-       printf("\n");
-}
-
 int main(void)
 {
        struct termios oldterm, term;
@@ -92,7 +76,8 @@ int main(void)
        setbuf(stdin, NULL);
 
        cl = cmdline_stdin_new(main_ctx, "root> ");
-       basic_char_loop();
+       cmdline_interact(cl);
+       cmdline_free(cl);
 
        tcsetattr(fileno(stdin), TCSANOW, &oldterm);
        return 0;