aboutsummaryrefslogtreecommitdiff
path: root/src/driver.c
diff options
context:
space:
mode:
authorFlavian Kaufmann <flavian@flaviankaufmann.ch>2025-05-22 13:23:18 +0200
committerFlavian Kaufmann <flavian@flaviankaufmann.ch>2025-05-22 13:23:18 +0200
commit6ef8829451871b534572d47312ae255dee088588 (patch)
tree3652795378f330452d8752dd9d1783a74a620d78 /src/driver.c
parent027fc783faa9a25b373099e0e0f86d3859b7235d (diff)
downloadimp-6ef8829451871b534572d47312ae255dee088588.tar.gz
imp-6ef8829451871b534572d47312ae255dee088588.zip
cleanup
Diffstat (limited to 'src/driver.c')
-rw-r--r--src/driver.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/driver.c b/src/driver.c
index 8902a55..441ee40 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -24,17 +24,15 @@ int main(int argc, char **argv) {
while ((opt = getopt(argc, argv, "i:a:h")) != -1) {
switch (opt) {
case 'i':
- interpret_file(optarg);
- return EXIT_SUCCESS;
+ return interpret_file(optarg) ? EXIT_FAILURE : EXIT_SUCCESS;
case 'a':
- print_ast_file(optarg);
- return EXIT_SUCCESS;
+ return print_ast_file(optarg) ? EXIT_FAILURE : EXIT_SUCCESS;
case 'h':
default:
fprintf(stderr,
"Usage: %s [ARGS]\n"
" (no args) start REPL\n"
- " -i <program.imp> interpret program and exit\n"
+ " -i <program.imp> interpret program\n"
" -a <program.imp> print ast\n"
" -h print this message\n",
argv[0]);