6 use MooseX::Runnable::Run; # incidentally, we don't actually use this...
11 my ($includes, $plugins, $app, $argv) = parse_argv();
13 unshift @INC, $_ for @$includes;
16 return MooseX::Runnable::Invocation->new(
18 plugins => $plugins || [],
23 # we need to parse "incrementally" so we can identify:
24 # - our args (-Ilib, and --help, -h, and -?)
25 # - plugins to load (+Plugin)
28 # code that's better than this is welcome!
30 my (@include, @plugins, $app);
32 while( my $arg = shift @ARGV ){
33 if ($arg =~ /^-I([^-]+)/){ # XXX: handle -I"quoted string" ?
36 elsif ($arg =~ /^\+\+?([A-Za-z:_]+)$/){ # second + is for +Foo::Bar
39 elsif ($arg =~ /^--([^-]+)$/){
43 if($arg =~ /^([A-Za-z:_]+)$/){
53 return \@include, \@plugins, $app, \@ARGV;
59 This is mx-run, a utility for running MooseX::Runnable classes.
60 usage: mx-run <mx-run options> Class::Name <options for Class::Name>
63 --help -? -h Print this message
64 +PluginName Load PluginName (see MooseX::Runnable::Invocation)
65 -I<path> Add <path> to @INC before loading Class::Name
67 To get help for Class::Name, run:
69 mx-run Class::Name --help
79 mx-run - script to run MooseX::Runnable classes