diff --git a/bin/minicpan_webserver b/bin/minicpan_webserver index 3a8026f..acaca22 100755 --- a/bin/minicpan_webserver +++ b/bin/minicpan_webserver @@ -14,10 +14,16 @@ use CPAN::Mini::Webserver; use Getopt::Long; my $port = 2963; -GetOptions( "port=i" => \$port, ); +my $daemon = 0; +GetOptions( 'port=i' => \$port, daemon => \$daemon ) or exit; my $server = CPAN::Mini::Webserver->new( $port ); -$server->run; +if ($daemon) { + $server->background; +} +else { + $server->run; +} __END__