Skip to content

Commit

Permalink
ENHANCED: app splfr to use new argv_options/4 ability to pass unkno…
Browse files Browse the repository at this point in the history
…wn options.
  • Loading branch information
JanWielemaker committed Jan 3, 2025
1 parent 85cac82 commit b299992
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions app/splfr.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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").

Expand Down

0 comments on commit b299992

Please sign in to comment.