'fork|f' => \$fork,
'help|?' => \$help,
'host=s' => \$host,
- 'port=s' => \$port,
+ 'port|p=s' => \$port,
'keepalive|k' => \$keepalive,
'restart|r' => \$restart,
'restartdelay|rd=s' => \$check_interval,
};
if ( $restart ) {
- require Catalyst::Restarter;
-
die "Cannot run in the background and also watch for changed files.\n"
if $background;
+ require Catalyst::Restarter;
+
+ my $subclass = Catalyst::Restarter->pick_subclass;
+
my %args;
$args{follow_symlinks} = 1
if $follow_symlinks;
$args{filter} = qr/$file_regex/
if defined $file_regex;
- my $restarter = Catalyst::Restarter->new(
+ my $restarter = $subclass->new(
%args,
start_sub => $runner,
+ argv => \@argv,
);
$restarter->run_and_watch;