fasterized
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Script / Server.pm
index af81693..fffde6a 100644 (file)
@@ -15,13 +15,25 @@ use namespace::autoclean;
 
 with 'MooseX::Getopt';
 
+has debug => (
+    traits => [qw(Getopt)],
+    cmd_aliases => 'd',
+    isa => 'Bool', 
+    is => 'ro',
+    documentation => qq{
+    -d --debug force debug mode    
+    }
+
+);
+
 has help => ( 
     traits => [qw(Getopt)],
     cmd_aliases => 'h',
     isa => 'Bool',   
     is => 'ro', 
-    , 
-    default => 0,  
+    documentation => qq{
+    -h --help display this help and exits    
+    },  
 );
 
 has host => ( 
@@ -62,7 +74,7 @@ has keepalive => (
     isa => 'Bool',   
     is => 'ro', 
     , 
-    default => 0 
+     
 );
 
 has background => ( 
@@ -113,14 +125,20 @@ has follow_symlinks => (
      
 );
 
+sub usage {
+    my ($self) = shift;
+    
+    return pod2usage();
+
+}
+
 my @argv = @ARGV;
 
 sub run {
     my $self = shift;
     
-    pod2usage() if $self->help;
+    $self->usage if $self->help;
     my $app = $self->app;
-    warn "App is $app";
     Class::MOP::load_class($app);
     $app->run(
         $self->listen, $self->host,
@@ -140,6 +158,8 @@ sub run {
 
 }
 
+no Moose;
+__PACKAGE__->meta->make_immutable;
 
 1;