No need for an around modifier, can quite happily be a before
[catagits/Catalyst-View-Component-SubInclude.git] / t / ESITest / script / esitest_create.pl
CommitLineData
e3c8a4c3 1#/usr/bin/perl -w
30726632 2
3use strict;
4use warnings;
5use Getopt::Long;
6use Pod::Usage;
7use Catalyst::Helper;
8
9my $force = 0;
10my $mech = 0;
11my $help = 0;
12
13GetOptions(
14 'nonew|force' => \$force,
15 'mech|mechanize' => \$mech,
16 'help|?' => \$help
17 );
18
19pod2usage(1) if ( $help || !$ARGV[0] );
20
21my $helper = Catalyst::Helper->new( { '.newfiles' => !$force, mech => $mech } );
22
23pod2usage(1) unless $helper->mk_component( 'ESITest', @ARGV );
24
251;
26
27=head1 NAME
28
29esitest_create.pl - Create a new Catalyst Component
30
31=head1 SYNOPSIS
32
33esitest_create.pl [options] model|view|controller name [helper] [options]
34
35 Options:
36 -force don't create a .new file where a file to be created exists
37 -mechanize use Test::WWW::Mechanize::Catalyst for tests if available
38 -help display this help and exits
39
40 Examples:
41 esitest_create.pl controller My::Controller
42 esitest_create.pl controller My::Controller BindLex
43 esitest_create.pl -mechanize controller My::Controller
44 esitest_create.pl view My::View
45 esitest_create.pl view MyView TT
46 esitest_create.pl view TT TT
47 esitest_create.pl model My::Model
48 esitest_create.pl model SomeDB DBIC::Schema MyApp::Schema create=dynamic\
49 dbi:SQLite:/tmp/my.db
50 esitest_create.pl model AnotherDB DBIC::Schema MyApp::Schema create=static\
51 dbi:Pg:dbname=foo root 4321
52
53 See also:
54 perldoc Catalyst::Manual
55 perldoc Catalyst::Manual::Intro
56
57=head1 DESCRIPTION
58
59Create a new Catalyst Component.
60
61Existing component files are not overwritten. If any of the component files
62to be created already exist the file will be written with a '.new' suffix.
63This behavior can be suppressed with the C<-force> option.
64
65=head1 AUTHORS
66
67Catalyst Contributors, see Catalyst.pm
68
69=head1 COPYRIGHT
70
71This library is free software, you can redistribute it and/or modify
72it under the same terms as Perl itself.
73
74=cut