First of all: raku (perl6) is amazing. And so is Cro. It only took a week-end to fall in love. However now I stumble over something that must be extremely simple.
If I use a slurpy parameter in a multiple dispatch MAIN this is recognized and works perfectly:
multi MAIN( 'config', 'add', *@hostnames ) {
However if I make this a non-slurpy array, this is either not recognized or I don't know how to provide it from the command line:
multi MAIN( 'config', 'add', @hostnames ) {
I would expect one of these invocations to work:
$ cli.raku config add www.example.com example.com
$ cli.raku config add www.example.com,example.com
$ cli.raku config add www.example.com, example.com
A similar construct is used in the Cro CLI however without example of how to call one of the commands with an array in the docs.
I also tried this with an array as named parameter:
my %*SUB-MAIN-OPTS = :named-anywhere;
multi MAIN( 'config', 'add', :@hostnames) {
Given the example in the raku docs I would expect this to work:
$ cli.raku config add --hostnames=www.example.com example.com
But it does not, nor variants with comma or space comma separation. In all cases I get the usage information.