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