aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/main.c b/main.c
index d6d8b1b..390c6ee 100644
--- a/main.c
+++ b/main.c
@@ -11,15 +11,22 @@ int main(int argc, char **argv)
SlothError err;
if (sloth == NULL)
return 1;
+ err = sloth_init(sloth);
+ if (err != NULL) {
+ fprintf(stderr, "%s\n", err);
+ free(sloth);
+ return 1;
+ }
+ puts("sloth v0.0.0, Copyright (c) 2023 kdx");
+ puts("sloth comes with ABSOLUTELY NO WARRANTY.");
+ puts("Enter EOF to exit.");
/* Read stdin line by line until exhaustion. */
char *line = NULL;
while ((line = getln(stdin)) != NULL) {
err = sloth_exec_line(sloth, line);
free(line);
- if (err != NULL) {
+ if (err != NULL)
fprintf(stderr, "%s\n", err);
- break;
- }
}
/* Free everything. */
getln_cleanup();