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