Created
July 7, 2014 19:19
-
-
Save hoelzro/e03fc6ab275563643d65 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v6; | |
my role App::Subcommander { | |
my role OptionCanonicalizer { | |
submethod BUILD(:&command) { | |
say &command.perl; | |
gather { | |
say &command.perl; | |
}; | |
} | |
} | |
my class DefaultOptionCanonicalizer does OptionCanonicalizer { | |
} | |
method run(@args) returns int { | |
my $subcommand = self.can('go-bool')[0]; | |
my $canonicalizer = DefaultOptionCanonicalizer.new(:command($subcommand)); | |
return 0; | |
} | |
} | |
my class App does App::Subcommander { | |
method go-bool(Str $arg?, Bool :$flag, Str :$node) {} | |
} | |
App.new.run(['go-bool', '--noflag', '--node', 'value']); | |
=begin output | |
method go-bool (App: Str $arg?, Bool :flag($flag), Str :node($node), *%_) { #`(Method|140026856274400) ... } | |
Nil | |
=end output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment