5 |
use Pod::Usage; |
use Pod::Usage; |
6 |
use Catalyst::Helper; |
use Catalyst::Helper; |
7 |
|
|
8 |
my $help = 0; |
my $force = 0; |
9 |
my $nonew = 0; |
my $help = 0; |
|
my $short = 0; |
|
10 |
|
|
11 |
GetOptions( |
GetOptions( |
12 |
'help|?' => \$help, |
'nonew|force' => \$force, |
13 |
'nonew' => \$nonew, |
'help|?' => \$help |
|
'short' => \$short |
|
14 |
); |
); |
15 |
|
|
16 |
pod2usage(1) if ( $help || !$ARGV[0] ); |
pod2usage(1) if ( $help || !$ARGV[0] ); |
17 |
|
|
18 |
my $helper = |
my $helper = Catalyst::Helper->new( { '.newfiles' => !$force } ); |
|
Catalyst::Helper->new( { '.newfiles' => !$nonew, short => $short } ); |
|
19 |
|
|
20 |
pod2usage(1) unless $helper->mk_component( 'Webpacus', @ARGV ); |
pod2usage(1) unless $helper->mk_component( 'Webpacus', @ARGV ); |
21 |
|
|
30 |
webpacus_create.pl [options] model|view|controller name [helper] [options] |
webpacus_create.pl [options] model|view|controller name [helper] [options] |
31 |
|
|
32 |
Options: |
Options: |
33 |
|
-force don't create a .new file where a file to be created exists |
34 |
-help display this help and exits |
-help display this help and exits |
|
-nonew don't create a .new file where a file to be created exists |
|
|
-short use short types, like C instead of Controller... |
|
35 |
|
|
36 |
Examples: |
Examples: |
37 |
webpacus_create.pl controller My::Controller |
webpacus_create.pl controller My::Controller |
52 |
|
|
53 |
Existing component files are not overwritten. If any of the component files |
Existing component files are not overwritten. If any of the component files |
54 |
to be created already exist the file will be written with a '.new' suffix. |
to be created already exist the file will be written with a '.new' suffix. |
55 |
This behavior can be suppressed with the C<-nonew> option. |
This behavior can be suppressed with the C<-force> option. |
56 |
|
|
57 |
=head1 AUTHOR |
=head1 AUTHOR |
58 |
|
|
59 |
Sebastian Riedel, C<sri\@oook.de> |
Sebastian Riedel, C<sri@oook.de> |
60 |
|
|
61 |
=head1 COPYRIGHT |
=head1 COPYRIGHT |
62 |
|
|