summaryrefslogtreecommitdiff
path: root/repl.pl
diff options
context:
space:
mode:
authorPeter Mikkelsen <peter@pmikkelsen.com>2021-07-18 18:22:05 +0000
committerPeter Mikkelsen <peter@pmikkelsen.com>2021-07-18 18:22:05 +0000
commitdaadb2b174846cda95e51e0c4c94bcb748da4a69 (patch)
tree5cca963b24754af9fdfd9dde95c0286cfa225df3 /repl.pl
parent18ae80eac7b678d71b13710b978a03863c7e3fd2 (diff)
Load extra arguments as module files
Diffstat (limited to 'repl.pl')
-rw-r--r--repl.pl8
1 files changed, 5 insertions, 3 deletions
diff --git a/repl.pl b/repl.pl
index a936535..8ecf286 100644
--- a/repl.pl
+++ b/repl.pl
@@ -12,9 +12,11 @@ repl([ProgName|Args]) :-
handle_arg('-d') :-
set_prolog_flag(debug, on).
handle_arg(Arg) :-
- write('Unhandled command line argument: '),
- writeq(Arg),
- nl.
+ ( '$load_module_from_file'(Arg)
+ -> write('Loaded module from file: ')
+ ; write('Failed to load module from file: ')
+ ),
+ write(Arg), nl.
handle_args([Arg|Rest]) :- handle_arg(Arg), !, handle_args(Rest).
handle_args([]).