don't need -except => [ qw(meta) ] with autoclean
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Script / CGI.pm
1 package Catalyst::Script::CGI;
2 use Moose;
3
4 BEGIN { $ENV{CATALYST_ENGINE} ||= 'CGI' }
5 use FindBin qw/$Bin/;
6 use lib "$Bin/../lib";
7 use Pod::Usage;
8 use Moose;
9 use namespace::autoclean;
10
11 with 'MooseX::Getopt';
12
13 has _app => (
14     reader   => 'app',
15     init_arg => 'app',
16     traits => [qw(NoGetopt)],
17     isa => 'Str',
18     is => 'ro',
19 );
20
21 has help => (
22     traits => [qw(Getopt)],
23     cmd_aliases => 'h',
24     isa => 'Bool',
25     is => 'ro',
26     documentation => qq{ display this help and exits },
27 );
28
29
30 sub run {
31     my $self = shift;
32
33     pod2usage() if $self->help;
34     my $app = $self->app;
35     Class::MOP::load_class($app);
36     $app->run;
37
38 }
39 1;