From: Jonathan Rockway Date: Wed, 29 Apr 2009 10:27:10 +0000 (-0500) Subject: add -M option X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6a06028aab89974506f1bccaf7ac11a9ebfaecc7;p=gitmo%2FMooseX-Runnable.git add -M option --- diff --git a/bin/mx-run b/bin/mx-run index 192f81d..5bcd615 100644 --- a/bin/mx-run +++ b/bin/mx-run @@ -35,6 +35,11 @@ sub parse_argv { if ($arg =~ /^-I([^-]+)/){ # XXX: handle -I"quoted string" ? push @include, $1; } + elsif ($arg =~ /^-M([^-]+)/){ + my $module = $1; + eval "use $module"; + die $@ if $@; + } elsif ($arg =~ /^\+\+?([A-Za-z:_]+)$/){ # second + is for +Foo::Bar push @plugins, $1; } @@ -63,8 +68,12 @@ usage: mx-run Class::Name mx-run options: --help -? -h Print this message - +PluginName Load PluginName (see MooseX::Runnable::Invocation) -I Add to @INC before loading Class::Name + -M use immediately + +PluginName Load PluginName (see MooseX::Runnable::Invocation) + +Note that as soon as +PluginName is seen, all -[IM] options are +ignored by mx-run, and are instead processed by PluginName. To get help for Class::Name, run: