Commit | Line | Data |
0ba6e8aa |
1 | package Catalyst::Script::CGI; |
accb0640 |
2 | use Moose; |
0ba6e8aa |
3 | |
accb0640 |
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::clean -except => [ qw(meta) ]; |
10 | |
11 | with 'MooseX::Getopt'; |
12 | |
13 | has app => ( isa => 'Str', is => 'ro', required => 1 ); |
14 | has help => ( isa => 'Bool', is => 'ro', required => 0, default => sub { 0 } ); |
15 | |
16 | sub run { |
17 | my $self = shift; |
18 | |
19 | pod2usage() if $self->help; |
20 | my $app = $self->app; |
21 | Class::MOP::load_class($app); |
22 | $app->run; |
23 | |
24 | } |
0ba6e8aa |
25 | 1; |