Short answer: just include --
before folder1
.
Long answer:
logic1.pl:
main :-
current_prolog_flag(argv, AllArgs),
append(_, [-- | Args], AllArgs),
writeln(Args).
Run with:
$ swipl -s logic1.pl -t main --quiet -- folder1
[folder1]