updated todo
[catagits/Catalyst-Devel.git] / TestAppForInvocation / script / testappforinvocation_create.pl
CommitLineData
7025ed89 1#!/usr/bin/env perl
2
3use strict;
4use warnings;
5use Getopt::Long;
6use Pod::Usage;
7eval "use Catalyst::Helper;";
8
9if ($@) {
10 die <<END;
11To use the Catalyst development tools including catalyst.pl and the
12generated script/myapp_create.pl you need Catalyst::Helper, which is
13part of the Catalyst-Devel distribution. Please install this via a
14vendor package or by running one of -
15
16 perl -MCPAN -e 'install Catalyst::Devel'
17 perl -MCPANPLUS -e 'install Catalyst::Devel'
18END
19}
20
21my $force = 0;
22my $mech = 0;
23my $help = 0;
24
25GetOptions(
26 'nonew|force' => \$force,
27 'mech|mechanize' => \$mech,
28 'help|?' => \$help
29 );
30
31pod2usage(1) if ( $help || !$ARGV[0] );
32
33my $helper = Catalyst::Helper->new( { '.newfiles' => !$force, mech => $mech } );
34
35pod2usage(1) unless $helper->mk_component( 'TestAppForInvocation', @ARGV );
36
371;
38
39=head1 NAME
40
41testappforinvocation_create.pl - Create a new Catalyst Component
42
43=head1 SYNOPSIS
44
45testappforinvocation_create.pl [options] model|view|controller name [helper] [options]
46
47 Options:
48 -force don't create a .new file where a file to be created exists
49 -mechanize use Test::WWW::Mechanize::Catalyst for tests if available
50 -help display this help and exits
51
52 Examples:
53 testappforinvocation_create.pl controller My::Controller
54 testappforinvocation_create.pl -mechanize controller My::Controller
55 testappforinvocation_create.pl view My::View
56 testappforinvocation_create.pl view MyView TT
57 testappforinvocation_create.pl view TT TT
58 testappforinvocation_create.pl model My::Model
59 testappforinvocation_create.pl model SomeDB DBIC::Schema MyApp::Schema create=dynamic\
60 dbi:SQLite:/tmp/my.db
61 testappforinvocation_create.pl model AnotherDB DBIC::Schema MyApp::Schema create=static\
62 dbi:Pg:dbname=foo root 4321
63
64 See also:
65 perldoc Catalyst::Manual
66 perldoc Catalyst::Manual::Intro
67
68=head1 DESCRIPTION
69
70Create a new Catalyst Component.
71
72Existing component files are not overwritten. If any of the component files
73to be created already exist the file will be written with a '.new' suffix.
74This behavior can be suppressed with the C<-force> option.
75
76=head1 AUTHORS
77
78Catalyst Contributors, see Catalyst.pm
79
80=head1 COPYRIGHT
81
82This library is free software. You can redistribute it and/or modify
83it under the same terms as Perl itself.
84
85=cut