And start the app correctly(ish) under the restarter - really not sure args are perse...
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Script / Server.pm
index 718e8c1..e40da5e 100644 (file)
@@ -13,6 +13,7 @@ use namespace::autoclean;
 with 'Catalyst::ScriptRole';
 
 has debug => (
+    traits => [qw(Getopt)],
     cmd_aliases => 'd',
     isa => Bool,
     is => 'ro',
@@ -20,6 +21,7 @@ has debug => (
 );
 
 has host => (
+    traits => [qw(Getopt)],
     isa => Str,
     is => 'ro',
     default => 'localhost',
@@ -27,6 +29,7 @@ has host => (
 );
 
 has fork => (
+    traits => [qw(Getopt)],
     cmd_aliases => 'f',
     isa => Bool,
     is => 'ro',
@@ -34,6 +37,7 @@ has fork => (
 );
 
 has listen => (
+    traits => [qw(Getopt)],
     cmd_aliases => 'l',
     isa => Int,
     is => 'ro',
@@ -42,6 +46,7 @@ has listen => (
 );
 
 has pidfile => (
+    traits => [qw(Getopt)],
     cmd_aliases => 'pid',
     isa => Str,
     is => 'ro',
@@ -49,6 +54,7 @@ has pidfile => (
 );
 
 has keepalive => (
+    traits => [qw(Getopt)],
     cmd_aliases => 'k',
     isa => Bool,
     is => 'ro',
@@ -57,6 +63,7 @@ has keepalive => (
 );
 
 has background => (
+    traits => [qw(Getopt)],
     cmd_aliases => 'bg',
     isa => Bool,
     is => 'ro',
@@ -64,6 +71,7 @@ has background => (
 );
 
 has restart => (
+    traits => [qw(Getopt)],
     cmd_aliases => 'r',
     isa => Bool,
     is => 'ro',
@@ -71,6 +79,7 @@ has restart => (
 );
 
 has restart_directory => (
+    traits => [qw(Getopt)],
     cmd_aliases => 'rdir',
     isa => ArrayRef[Str],
     is  => 'ro',
@@ -79,6 +88,7 @@ has restart_directory => (
 );
 
 has restart_delay => (
+    traits => [qw(Getopt)],
     cmd_aliases => 'rdel',
     isa => Int,
     is => 'ro',
@@ -140,8 +150,8 @@ sub run {
 
         my $restarter = $subclass->new(
             %args,
-            start_sub => sub { $self->_run },
-            argv      => \$self->ARGV,
+            start_sub => sub { $self->_run_application },
+            argv      => $self->ARGV,
         );
 
         $restarter->run_and_watch;
@@ -177,11 +187,11 @@ __PACKAGE__->meta->make_immutable;
 
 =head1 NAME
 
-[% appprefix %]_server.pl - Catalyst Testserver
+Catalyst::Script::Server - Catalyst test server
 
 =head1 SYNOPSIS
 
-[% appprefix %]_server.pl [options]
+ myapp_server.pl [options]
 
  Options:
    -d     --debug          force debug mode
@@ -212,7 +222,7 @@ __PACKAGE__->meta->make_immutable;
 
 =head1 DESCRIPTION
 
-Run a Catalyst Testserver for this application.
+Run a Catalyst test server for this application.
 
 =head1 AUTHORS