]>
git.saurik.com Git - redis.git/blob - deps/linenoise/example.c
6 void completion(const char *buf
, linenoiseCompletions
*lc
) {
8 linenoiseAddCompletion(lc
,"hello");
9 linenoiseAddCompletion(lc
,"hello there");
16 linenoiseSetCompletionCallback(completion
);
17 linenoiseHistoryLoad("history.txt"); /* Load the history at startup */
18 while((line
= linenoise("hello> ")) != NULL
) {
19 if (line
[0] != '\0') {
20 printf("echo: '%s'\n", line
);
21 linenoiseHistoryAdd(line
);
22 linenoiseHistorySave("history.txt"); /* Save every new entry */