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