summaryrefslogtreecommitdiff
path: root/repl.pl
diff options
context:
space:
mode:
authorPeter Mikkelsen <peter@pmikkelsen.com>2021-07-22 19:35:53 +0000
committerPeter Mikkelsen <peter@pmikkelsen.com>2021-07-22 19:35:53 +0000
commit0f347162b74d945f509955b6c57e506ab800db7b (patch)
treea5c5fb36dc632b5e2f387058b8170e0811001af8 /repl.pl
parent77c7fea4cee74562ad60c7ce96ca830a7ebda8b7 (diff)
Implement halt/0, halt/1, and understand the --no-repl flag
Diffstat (limited to 'repl.pl')
-rw-r--r--repl.pl12
1 files changed, 5 insertions, 7 deletions
diff --git a/repl.pl b/repl.pl
index 0bb279f..8f68551 100644
--- a/repl.pl
+++ b/repl.pl
@@ -1,17 +1,15 @@
:- module(repl, []).
repl([_ProgName|Args]) :-
- write('Welcome to p-prolog version 1.'),
- nl,
- write('Started with args: '),
- write(Args),
- nl,
- flush_output,
handle_args(Args),
- repl_loop.
+ ( member('--no-repl', Args)
+ -> halt
+ ; repl_loop
+ ).
handle_arg('-d') :-
set_prolog_flag(debug, on).
+handle_arg('--no-repl').
handle_arg(Arg) :-
loader:load_module_from_file(Arg).