On 06/01/2017 02:11 PM, Timo Paulssen wrote:
It seems like this only works if you supply --dirs= multiple times
perl6 -e 'sub MAIN (List :$dirs=[]) { .say for @$dirs }' --dirs=d1
--dirs=d2 --dirs=d3
d1
d2
d3
HTH
- Timo
Thanks Timo,
Just tested this and it works. But there is still a problem and maybe a
bug. It should accept a single option to have a list with one item. In
that case it shows the usage message.
FWIW, I've cooked up a short piece to have it my way
my @a;
for @*ARGS -> $a {
if $a ~~ m/^ '--dirs'/ {
for $a.split('=')[1].split(',') -> $d {
@a.push("--dirs=$d");
}
}
else {
@a.push($a);
}
}
@*ARGS = @a;
sub MAIN (List :$dirs=[]) { }
Regards