aboutsummaryrefslogtreecommitdiff
path: root/tsalis/src
diff options
context:
space:
mode:
authorPaul Oliver <contact@pauloliver.dev>2024-02-29 01:50:45 +0100
committerPaul Oliver <contact@pauloliver.dev>2024-02-29 01:50:45 +0100
commit9a094c5c67fa1408c96e556e95f52f15dc5efda6 (patch)
treebc40a048e1839f8cdadad6c8ff8accd71e142619 /tsalis/src
parente070c5fe084d181654e8090d6e5ee1faef873060 (diff)
Better command-line arguments for TSalis.
TSalis may now be started using more standard arguments: "-n", "--new", "-l" and "--load". Also, updated README file to address this and previous changes.
Diffstat (limited to 'tsalis/src')
-rw-r--r--tsalis/src/printer.c2
-rw-r--r--tsalis/src/tsalis.c13
2 files changed, 7 insertions, 8 deletions
diff --git a/tsalis/src/printer.c b/tsalis/src/printer.c
index c835f24..ec01ada 100644
--- a/tsalis/src/printer.c
+++ b/tsalis/src/printer.c
@@ -102,12 +102,14 @@ tsp_check(void)
return SFALSE;
}
+ endwin();
return STRUE;
}
void
tsp_init(void)
{
+ initscr();
cbreak();
noecho();
curs_set(0);
diff --git a/tsalis/src/tsalis.c b/tsalis/src/tsalis.c
index 7722ca9..dc57fa4 100644
--- a/tsalis/src/tsalis.c
+++ b/tsalis/src/tsalis.c
@@ -59,14 +59,11 @@ init(int argc, char **argv)
if (argc == 1) {
onDefault();
- } else if (argc == 2) {
- char cmd = argv[1][0];
- char *val = &argv[1][1];
-
- if (cmd == 'n') {
- s_init(atoi(val));
- } else if (cmd == 'l') {
- onLoad(val);
+ } else if (argc == 3) {
+ if (!strcmp(argv[1], "-n") || !strcmp(argv[1], "--new")) {
+ s_init(atoi(argv[2]));
+ } else if (!strcmp(argv[1], "-l") || !strcmp(argv[1], "--load")) {
+ onLoad(argv[2]);
} else {
fputs("ERROR: Incorrect arguments\n", stderr);
exit(1);