I am trying to overload a function to detect no arguments have been passed:
package Documentable::CLI {
sub RUN-MAIN(|c) is export {
my %*SUB-MAIN-OPTS = :named-anywhere;
CORE::<&RUN-MAIN>(|c)
}
our proto MAIN(|) is export { * }
multi MAIN (
Bool :V(:$version)
) {}
multi MAIN () {
say 'Execute "documentable --help" for more information'
}
}
# no output
Documentable::CLI::MAIN();
If you try to use multi main (*@args) {} it will not work either. BUT if you delete the first multi MAIN definition everything will work smoothly. Any idea how to solve it?