From 0f347162b74d945f509955b6c57e506ab800db7b Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Thu, 22 Jul 2021 19:35:53 +0000 Subject: Implement halt/0, halt/1, and understand the --no-repl flag --- repl.pl | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'repl.pl') 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). -- cgit v1.2.3