aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/main.c b/main.c
index ab1864d..3a1c2f2 100644
--- a/main.c
+++ b/main.c
@@ -13,12 +13,10 @@
* Description: Entrypoint
*/
-#include "./base.h"
-#include "./lisp.h"
-#include "./memory.h"
-#include "./reader.h"
-#include "./sv.h"
-#include "./vec.h"
+#include <lib/sv.h>
+#include <lib/vec.h>
+#include <lisp/lisp.h>
+#include <lisp/reader.h>
#include <assert.h>
#include <ctype.h>
@@ -27,6 +25,15 @@
#include <stdio.h>
#include <string.h>
+void usage(char *prog_name, FILE *fp)
+{
+ fprintf(fp,
+ "Usage: %s [FILE]\n"
+ "Interpret FILE as scheme in the OATS interpreter.\n"
+ "\t[FILE]: name of file\n",
+ prog_name);
+}
+
int main(int argc, char *argv[])
{
int exit = 0;
@@ -36,7 +43,10 @@ int main(int argc, char *argv[])
if (argc > 1)
filename = argv[1];
else
- filename = "./r7rs-tests.scm";
+ {
+ usage(argv[0], stderr);
+ return 1;
+ }
FILE *fp = fopen(filename, "r");
if (!fp)