Updated PAR to only package non-core modules
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Helper.pm
index 867d527..51039ca 100644 (file)
@@ -2,7 +2,6 @@ package Catalyst::Helper;
 
 use strict;
 use base 'Class::Accessor::Fast';
-use Config;
 use File::Spec;
 use File::Path;
 use IO::File;
@@ -64,7 +63,7 @@ sub mk_app {
     $self->{dir} =~ s/\:\:/-/g;
     $self->{script}    = File::Spec->catdir( $self->{dir}, 'script' );
     $self->{appprefix} = Catalyst::Utils::appprefix($name);
-    $self->{startperl} = $Config{startperl};
+    $self->{startperl} = '#!/usr/bin/perl -w';
     $self->{scriptgen} = $Catalyst::CATALYST_SCRIPT_GEN || 4;
     $self->{author}    = $self->{author} = $ENV{'AUTHOR'}
       || eval { @{ [ getpwuid($<) ] }[6] }
@@ -990,15 +989,21 @@ use Getopt::Long;
 use Pod::Usage;
 use Catalyst::PAR;
 
+my $engine = 'CGI';
 my $help = 0;
+my $par = '[% appprefix %].par';
 
-GetOptions( 'help|?' => \$help );
+GetOptions(
+    'engine=s' => \$engine,
+    'help|?'   => \$help,
+    'par=s'    => \$par
+);
 
 pod2usage(1) if $help;
 
-my $par = Catalyst::PAR->new->package( {
-    par    => $ARGV[0] || '[% appprefix %].par',
-    engine => $ARGV[1],
+Catalyst::PAR->new->package( {
+    engine => $engine,
+    par    => $par,
     class  => '[% name %]'
 } );
 
@@ -1010,10 +1015,12 @@ my $par = Catalyst::PAR->new->package( {
 
 =head1 SYNOPSIS
 
-[% appprefix %]_package.pl [par] [engine]
+[% appprefix %]_package.pl
 
  Options:
+   -engine   engine to use for dependency detection
    -help     display this help and exits
+   -par      name for the par archive
 
  Examples:
    [% appprefix %]_package.pl [% appprefix %].par FastCGI