I have a package with multiple main and I want to define several options:
My code is something like this:
package Perl6::Documentable::CLI {
proto MAIN(|) is export {*}
my %*SUB-MAIN-OPTS = :named-everywhere;
multi MAIN(
"setup"
) { ... }
multi MAIN (
"start" ,
Str :$topdir = "doc",
Bool :v(:verbose($v)) = False
) { ... }
But when I try to actually execute it with:
perl6 -Ilib bin/documentable start -v --topdir=ss
It outputs this line:
Usage:
bin/documentable [--topdir=<Str>] [-v|--verbose] start
I am using %*SUB-MAIN-OPTS but it looks like it does not work neither.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…