#include <signal.h>
#include <string.h>
#include "advent.h"
-#include "linenoise/linenoise.h"
#include "dungeon.h"
#define DIM(a) (sizeof(a)/sizeof(a[0]))
FILE *logfp = NULL, *rfp = NULL;
bool oldstyle = false;
-bool editline = true;
bool prompt = true;
// LCOV_EXCL_START
/* Options. */
#ifndef ADVENT_NOSAVE
- const char* opts = "l:or:s";
- const char* usage = "Usage: %s [-l logfilename] [-o] [-r restorefilename] [-s] \n";
+ const char* opts = "l:or";
+ const char* usage = "Usage: %s [-l logfilename] [-o] [-r restorefilename]\n";
#else
- const char* opts = "l:os";
- const char* usage = "Usage: %s [-l logfilename] [-o] [-s] \n";
+ const char* opts = "l:o";
+ const char* usage = "Usage: %s [-l logfilename] [-o]\n";
#endif
while ((ch = getopt(argc, argv, opts)) != EOF) {
switch (ch) {
break;
case 'o':
oldstyle = true;
- editline = prompt = false;
+ prompt = false;
break;
#ifndef ADVENT_NOSAVE
case 'r':
signal(SIGINT, sig_handler);
break;
#endif
- case 's':
- editline = false;
- break;
default:
fprintf(stderr,
usage, argv[0]);
fprintf(stderr,
" -r restore from specified saved game file\n");
#endif
- fprintf(stderr,
- " -s suppress command editing\n");
exit(EXIT_FAILURE);
break;
}
}
- linenoiseHistorySetMaxLen(350);
-
/* Initialize game variables */
long seedval = initialise();
}
strncpy(inputbuf, input, LINESIZE - 1);
- linenoiseFree(input);
+ free(input);
long tokens[4];
tokenize(inputbuf, tokens);