doc fixes; 0.01 release
[gitmo/MooseX-Runnable.git] / lib / MooseX / Runnable / Invocation / Scheme / MooseX / Getopt.pm
CommitLineData
780724cb 1package MooseX::Runnable::Invocation::Scheme::MooseX::Getopt;
2use Moose::Role;
3
4around validate_class => sub {
5 return; # always valid
6};
7
8around 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
d35780c7 19# XXX: arounds that don't actually call $orig fuck up plugins. i
20# think that's OK, mostly, but it's something to keep in mind...
21
780724cb 221;
00d7989a 23
24__END__
25
26=head1 NAME
27
28MooseX::Runnable::Invocation::Scheme::MooseX::Getopt - run MX::Getopt classes
29
30=head1 DESCRIPTION
31
32This role will be used by C<MooseX::Runnable::Invocation> to create an
33instance of the class to be run with C<MooseX::Getopt>. Any args not
34consumed by MX::Getopt will be passed to the class's run method.
35
36(See the test C<t/basic-mx-getopt.t> for an example.)
37
fc5720d5 38=head1 SEE ALSO
39
40L<MooseX::Runnable>
41
42L<MooseX::Getopt>