]> git.saurik.com Git - redis.git/blame - deps/linenoise/example.c
Remove warning.
[redis.git] / deps / linenoise / example.c
CommitLineData
e902b579
PN
1#include <stdio.h>
2#include <stdlib.h>
3#include "linenoise.h"
4
5int main(void) {
6 char *line;
7
8 linenoiseHistoryLoad("history.txt"); /* Load the history at startup */
9 while((line = linenoise("hello> ")) != NULL) {
10 if (line[0] != '\0') {
11 printf("echo: '%s'\n", line);
12 linenoiseHistoryAdd(line);
13 linenoiseHistorySave("history.txt"); /* Save every new entry */
14 }
15 free(line);
16 }
17 return 0;
18}