e2861517d1adc71b93b127bfbf4c5ffc81d37625
[gitmo/MooseX-Runnable.git] / lib / MooseX / Runnable / Invocation / Scheme / MooseX / Getopt.pm
1 package MooseX::Runnable::Invocation::Scheme::MooseX::Getopt;
2 use Moose::Role;
3
4 around validate_class => sub {
5     return; # always valid
6 };
7
8 around create_instance => sub {
9     my ($next, $self, $class, @args) = @_;
10
11     local @ARGV = @args; # ugly!
12     my $instance = $class->name->new_with_options();
13
14     my $more_args = $instance->extra_argv;
15
16     return ($instance, @$more_args);
17 };
18
19 1;