I will refer to eight_puzzle.pl, the module I posted for another answer as test case. Then I write a new file (say p8.pl) with a test argument line usage, compile and run
:- use_module(eight_puzzle).
go :-
current_prolog_flag(argv, Argv),
writeln(argv:Argv),
( nth1(Test_id_flag, Argv, '--test_id'),
Test_id_pos is Test_id_flag+1,
nth1(Test_id_pos, Argv, Id)
-> atom_concat(test, Id, Func)
; Func = test1
),
forall(time(call(eight_puzzle:Func, R)), writeln(R)).
to compile I used the documentation section 2.10.2.4 from 2.10 Compilation
swipl -O --goal=go --stand_alone=true -o p8 -c p8.pl
and to run with specified option:
./p8 --test_id 0
I'm running Ubuntu, but there should be no differences on Windows.
argv:[./p8,--test_id,0]
% 4,757 inferences, 0.003 CPU in 0.003 seconds (100% CPU, 1865842 Lips)
[4,3,6,7,8]
% 9,970 inferences, 0.005 CPU in 0.005 seconds (100% CPU, 2065656 Lips)
[4,3,6,7,4,5,8,7,4,5,8,7,4,5,8]
...
HTH