X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FScript%2FTest.pm;h=ae8c3528189ab72f0b6823297c0f414706a7414d;hb=f4dc8d2fe3a7882572f540b1907b3153a20f909e;hp=8431fd2b3871119c8dd3254203b4d3da06a2b15e;hpb=451b2a4432a971fe5d12e108545677eb94295fab;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Script/Test.pm b/lib/Catalyst/Script/Test.pm index 8431fd2..ae8c352 100644 --- a/lib/Catalyst/Script/Test.pm +++ b/lib/Catalyst/Script/Test.pm @@ -4,10 +4,23 @@ use Pod::Usage; use FindBin; use lib "$FindBin::Bin/../lib"; with 'MooseX::Getopt'; -use namespace::clean -except => [ qw(meta) ]; +use namespace::autoclean; -has app => ( isa => 'Str', is => 'ro', required => 1 ); -has help => ( isa => 'Bool', is => 'ro', required => 0, default => sub { 0 } ); +has _app => ( + reader => 'app', + init_arg => 'app', + traits => [qw(NoGetopt)], + isa => 'Str', + is => 'ro', +); + +has help => ( + traits => [qw(Getopt)], + cmd_aliases => 'h', + isa => 'Bool', + is => 'ro', + documentation => qq{ display this help and exits }, +); sub run { @@ -15,10 +28,10 @@ sub run { Class::MOP::load_class("Catalyst::Test"); Catalyst::Test->import($self->app); - + pod2usage(1) if ( $self->help || !$ARGV[1] ); print request($ARGV[1])->content . "\n"; - + } 1;