DWIM continuation statistics
[catagits/Catalyst-Runtime.git] / script / catalyst.pl
CommitLineData
fc7ec1d9 1#!/usr/bin/perl -w
2
3use strict;
4use Getopt::Long;
5use Pod::Usage;
6use Catalyst::Helper;
7
4e90e3c1 8my $force = 0;
9my $help = 0;
10my $makefile = 0;
11my $scripts = 0;
12my $short = 0;
fc7ec1d9 13
1c773d18 14GetOptions(
640faa87 15 'help|?' => \$help,
16 'force|nonew' => \$force,
4e90e3c1 17 'makefile' => \$makefile,
640faa87 18 'scripts' => \$scripts,
19 'short' => \$short
1c773d18 20);
fc7ec1d9 21
22pod2usage(1) if ( $help || !$ARGV[0] );
23
4e90e3c1 24my $helper = Catalyst::Helper->new( {
25 '.newfiles' => !$force,
26 'makefile' => $makefile,
27 'scripts' => $scripts,
28 'short' => $short,
29} );
fc7ec1d9 30pod2usage(1) unless $helper->mk_app( $ARGV[0] );
31
321;
33__END__
34
35=head1 NAME
36
37catalyst - Bootstrap a Catalyst application
38
39=head1 SYNOPSIS
40
d459eb44 41catalyst.pl [options] application-name
fc7ec1d9 42
43 Options:
640faa87 44 -force don't create a .new file where a file to be created exists
e4d88362 45 -help display this help and exits
4e90e3c1 46 -makefile update Makefile.PL only
e4d88362 47 -scripts update helper scripts only
48 -short use short types, like C instead of Controller...
fc7ec1d9 49
4be535b1 50 application-name must be a valid Perl module name and can include "::"
fc7ec1d9 51
52 Examples:
d459eb44 53 catalyst.pl My::App
54 catalyst.pl MyApp
fc7ec1d9 55
ae1e6b59 56 To upgrade your app to a new version of Catalyst:
640faa87 57 catalyst.pl -force -scripts MyApp
ae1e6b59 58
03a53815 59
fc7ec1d9 60=head1 DESCRIPTION
61
4be535b1 62The C<catalyst.pl> script bootstraps a Catalyst application, creating a
63directory structure populated with skeleton files.
64
65The application name must be a valid Perl module name. The name of the
66directory created is formed from the application name supplied, with double
67colons replaced with hyphens (so, for example, the directory for C<My::App> is
68C<My-App>).
69
70Using the example application name C<My::App>, the application directory will
71contain the following items:
72
73=over 4
74
75=item README
76
77a skeleton README file, which you are encouraged to expand on
78
4be535b1 79=item Changes
80
81a changes file with an initial entry for the creation of the application
82
83=item Makefile.PL
84
b1882228 85Makefile.PL uses the C<Module::Install> system for packaging and distribution
86of the application.
4be535b1 87
88=item lib
89
90contains the application module (C<My/App.pm>) and
91subdirectories for model, view, and controller components (C<My/App/M>,
92C<My/App/V>, and C<My/App/C>).
93
94=item root
95
96root directory for your web document content. This is left empty.
97
98=item script
99
100a directory containing helper scripts:
101
102=over 4
103
b1882228 104=item C<myapp_create.pl>
4be535b1 105
106helper script to generate new component modules
107
b1882228 108=item C<myapp_server.pl>
4be535b1 109
110runs the generated application within a Catalyst test server, which can be
111used for testing without resorting to a full-blown web server configuration.
112
b1882228 113=item C<myapp_cgi.pl>
4be535b1 114
115runs the generated application as a CGI script
116
b1882228 117=item C<myapp_fastcgi.pl>
4be535b1 118
119runs the generated application as a FastCGI script
120
b1882228 121=item C<myapp_test.pl>
4be535b1 122
123runs an action of the generated application from the comand line.
124
125=back
126
127=item t
128
129test directory
130
131=back
132
133
134The application module generated by the C<catalyst.pl> script is functional,
1c773d18 135although it reacts to all requests by outputting a friendly welcome screen.
4be535b1 136
137
138=head1 NOTE
139
140Neither C<catalyst.pl> nor the generated helper script will overwrite existing
141files. In fact the scripts will generate new versions of any existing files,
142adding the extension C<.new> to the filename. The C<.new> file is not created
143if would be identical to the existing file.
144
145This means you can re-run the scripts for example to see if newer versions of
146Catalyst or its plugins generate different code, or to see how you may have
147changed the generated code (although you do of course have all your code in a
148version control system anyway, don't you ...).
149
150
fc7ec1d9 151
03a53815 152=head1 SEE ALSO
153
4be535b1 154L<Catalyst::Manual>, L<Catalyst::Manual::Intro>
03a53815 155
fc7ec1d9 156=head1 AUTHOR
157
1c773d18 158Sebastian Riedel, C<sri@oook.de>,
159Andrew Ford, C<A.Ford@ford-mason.co.uk>
4be535b1 160
fc7ec1d9 161
162=head1 COPYRIGHT
163
4be535b1 164Copyright 2004-2005 Sebastian Riedel. All rights reserved.
fc7ec1d9 165
1c773d18 166This library is free software, you can redistribute it and/or modify it under
167the same terms as Perl itself.
fc7ec1d9 168
169=cut