example.c revision 199767f8919635c4928607450d9e0abb932109ce
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "linenoise.h"
if (buf[0] == 'h') {
}
}
char *line;
/* Parse options, with --multiline we enable multi line editing. */
while(argc > 1) {
argc--;
argv++;
printf("Multi-line mode enabled.\n");
exit(0);
} else {
exit(1);
}
}
/* Set the completion callback. This will be called every time the
* user uses the <tab> key. */
/* Load history from file. The history file is just a plain text file
* where entries are separated by newlines. */
/* Now this is the main loop of the typical linenoise-based application.
* The call to linenoise() will block as long as the user types something
* and presses enter.
*
* The typed string is returned as a malloc() allocated string by
* linenoise, so the user needs to free() it. */
/* Do something with the string. */
/* The "/historylen" command will change the history len. */
} else if (line[0] == '/') {
}
}
return 0;
}