From b299992e98febe34dd3c001370de09277c40fb14 Mon Sep 17 00:00:00 2001 From: Jan Wielemaker Date: Fri, 3 Jan 2025 10:55:53 +0100 Subject: [PATCH] ENHANCED: app `splfr` to use new argv_options/4 ability to pass unknown options. --- app/splfr.pl | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/app/splfr.pl b/app/splfr.pl index aeec98bdf0..7cbf15636a 100755 --- a/app/splfr.pl +++ b/app/splfr.pl @@ -60,14 +60,7 @@ :- debug(swipl_frl). main(Argv) :- - append(Opts, [Stop|Rest], Argv), - ( Stop == '--' - -> Inputs = Rest - ; \+ sub_atom(Stop, 0, _, _, '--') - -> Inputs = [Stop|Rest] - ), - !, - argv_options(Opts, _, Options), + argv_options(Argv, Inputs, Options, [unknown_option(pass)]), ( catch(swipl_frl(Inputs, Options), Error, ( print_message(error, Error), halt(1) @@ -80,11 +73,16 @@ opt_type(cflag, cflag, atom). opt_help(help(header), - "Emulator for SICStus splfr"). + md("# Emulator for SICStus splfr\n\n\c + The `splfr` app provides a partial emulation for the \c + SICStus Prolog way of linking foreign resources. + ")). opt_help(help(usage), " [option ...] inputs ..."). opt_help(help(footer), - "Very incomplete!"). + md("The command line should have exactly one Prolog file. \c + All remaining options except for the documented options are \c + passed to the C compiler.")). opt_help(cflag, "Flags to pass to the C compiler").