X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=example.c;h=cb51a0af8f9259eca7504261e63bb35627f3cc5c;hb=8e93cca40fe18d13acc8f0cd56166da6ddb144a4;hp=ea0b515c1fce3a1f2100a4f3315d1613444dc56f;hpb=493a55014a4341dc8120ef603acc9d2af2a2b070;p=linenoise.git diff --git a/example.c b/example.c index ea0b515..cb51a0a 100644 --- a/example.c +++ b/example.c @@ -2,18 +2,21 @@ #include #include "linenoise.h" - +#ifndef NO_COMPLETION void completion(const char *buf, linenoiseCompletions *lc) { if (buf[0] == 'h') { linenoiseAddCompletion(lc,"hello"); linenoiseAddCompletion(lc,"hello there"); } } +#endif int main(void) { char *line; +#ifndef NO_COMPLETION linenoiseSetCompletionCallback(completion); +#endif linenoiseHistoryLoad("history.txt"); /* Load the history at startup */ while((line = linenoise("hello> ")) != NULL) { if (line[0] != '\0') {