=== modified file 'shell.pl' --- shell.pl 2012-05-21 07:02:28 +0000 +++ shell.pl 2012-05-19 09:32:20 +0000 @@ -26,8 +26,9 @@ integer(Code), assert_string(Rest). -assert_dcg_string(List, List) :- - assertion(assert_string(List)). +assert_dcg_string(L1, L2) :- + assertion(assert_string(L1)), + assertion(assert_string(L2)). escape(In, Out) :- escape(sh, In, Out). @@ -69,9 +70,7 @@ cmd_escape_runnable(Runnable), prepend(" )"). -check_returncode --> - assert_dcg_string, - prepend(" || exit $?\n"). +check_returncode --> assert_dcg_string, prepend(" || exit $?\n"). cmd_tokens(verbatim(Verbatim)) --> assert_dcg_string, @@ -170,7 +169,7 @@ cmd_repr(Command) :- write('representation of: '), writeq(Command), write(' ::'), nl, - ( setof(String, cmd_format(Command, String), Solutions) + ( setof(Lines , maplist(cmd_format, [Command], Lines), Solutions) -> maplist(print_solution, Solutions) ; write('FAILED!'), nl, trace, cmd_format(Command, _) ).