zef search includes :$update
as a named argument:
multi MAIN('search', Int :$wrap = False, :$update, *@terms ($, *@))
However, it's not recognized as such:
% zef search --update
Usage:
/home/jmerelo/.rakudobrew/bin/../moar-2019.03.1/install/share/perl6/site/bin/zef [--wrap=<Int>] search [<terms> ...] -- Get a list of possible distribution candidates for the given terms
/home/jmerelo/.rakudobrew/bin/../moar-2019.03.1/install/share/perl6/site/bin/zef [--version] -- Detailed version information
/home/jmerelo/.rakudobrew/bin/../moar-2019.03.1/install/share/perl6/site/bin/zef [-h|--help]
What am I missing here? How could I assign a value to this $update
?
If I run this MAIN
candidate by itself, it works:
$ perl6 -e 'multi MAIN("search", Int :$wrap = False, :$update, *@terms ($, *@)) { say "foo" }' search --update
foo
so it looks to me there is more than one candidate that matches, and that causes the USAGE feedback message to appear.
Named parameters are used as tie-breakers only, unless they are made mandatory (which makes them effectively a part of the dispatch process). So maybe the fix is to make two candidates:
multi MAIN('search', Int :$wrap = False, :$update!, *@terms ($, *@)) { ... }
multi MAIN('search', Int :$wrap = False, *@terms ($, *@)) { ... }
?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With