1 |
#!/usr/bin/perl -w |
2 |
|
3 |
use strict; |
4 |
use Getopt::Long; |
5 |
use Pod::Usage; |
6 |
use Catalyst::Helper; |
7 |
|
8 |
my $force = 0; |
9 |
my $help = 0; |
10 |
|
11 |
GetOptions( |
12 |
'nonew|force' => \$force, |
13 |
'help|?' => \$help |
14 |
); |
15 |
|
16 |
pod2usage(1) if ( $help || !$ARGV[0] ); |
17 |
|
18 |
my $helper = Catalyst::Helper->new( { '.newfiles' => !$force } ); |
19 |
|
20 |
pod2usage(1) unless $helper->mk_component( 'Webpacus', @ARGV ); |
21 |
|
22 |
1; |
23 |
|
24 |
=head1 NAME |
25 |
|
26 |
webpacus_create.pl - Create a new Catalyst Component |
27 |
|
28 |
=head1 SYNOPSIS |
29 |
|
30 |
webpacus_create.pl [options] model|view|controller name [helper] [options] |
31 |
|
32 |
Options: |
33 |
-force don't create a .new file where a file to be created exists |
34 |
-help display this help and exits |
35 |
|
36 |
Examples: |
37 |
webpacus_create.pl controller My::Controller |
38 |
webpacus_create.pl view My::View |
39 |
webpacus_create.pl view MyView TT |
40 |
webpacus_create.pl view TT TT |
41 |
webpacus_create.pl model My::Model |
42 |
webpacus_create.pl model SomeDB CDBI dbi:SQLite:/tmp/my.db |
43 |
webpacus_create.pl model AnotherDB CDBI dbi:Pg:dbname=foo root 4321 |
44 |
|
45 |
See also: |
46 |
perldoc Catalyst::Manual |
47 |
perldoc Catalyst::Manual::Intro |
48 |
|
49 |
=head1 DESCRIPTION |
50 |
|
51 |
Create a new Catalyst Component. |
52 |
|
53 |
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. |
55 |
This behavior can be suppressed with the C<-force> option. |
56 |
|
57 |
=head1 AUTHOR |
58 |
|
59 |
Sebastian Riedel, C<sri@oook.de> |
60 |
|
61 |
=head1 COPYRIGHT |
62 |
|
63 |
Copyright 2004 Sebastian Riedel. All rights reserved. |
64 |
|
65 |
This library is free software, you can redistribute it and/or modify |
66 |
it under the same terms as Perl itself. |
67 |
|
68 |
=cut |