todo.org: Added.
[Fumo.git] / script / fumo_create.pl
blobce6db2140af7c48ecf9e97bd9bc3427cc49eb5ea
1 #!/usr/bin/perl -w
3 use strict;
4 use warnings;
5 use Getopt::Long;
6 use Pod::Usage;
7 use Catalyst::Helper;
9 my $force = 0;
10 my $mech = 0;
11 my $help = 0;
13 GetOptions(
14 'nonew|force' => \$force,
15 'mech|mechanize' => \$mech,
16 'help|?' => \$help
19 pod2usage(1) if ( $help || !$ARGV[0] );
21 my $helper = Catalyst::Helper->new( { '.newfiles' => !$force, mech => $mech } );
23 pod2usage(1) unless $helper->mk_component( 'Fumo', @ARGV );
27 =head1 NAME
29 fumo_create.pl - Create a new Catalyst Component
31 =head1 SYNOPSIS
33 fumo_create.pl [options] model|view|controller name [helper] [options]
35 Options:
36 -force don't create a .new file where a file to be created exists
37 -mechanize use Test::WWW::Mechanize::Catalyst for tests if available
38 -help display this help and exits
40 Examples:
41 fumo_create.pl controller My::Controller
42 fumo_create.pl controller My::Controller BindLex
43 fumo_create.pl -mechanize controller My::Controller
44 fumo_create.pl view My::View
45 fumo_create.pl view MyView TT
46 fumo_create.pl view TT TT
47 fumo_create.pl model My::Model
48 fumo_create.pl model SomeDB DBIC::Schema MyApp::Schema create=dynamic\
49 dbi:SQLite:/tmp/my.db
50 fumo_create.pl model AnotherDB DBIC::Schema MyApp::Schema create=static\
51 dbi:Pg:dbname=foo root 4321
53 See also:
54 perldoc Catalyst::Manual
55 perldoc Catalyst::Manual::Intro
57 =head1 DESCRIPTION
59 Create a new Catalyst Component.
61 Existing component files are not overwritten. If any of the component files
62 to be created already exist the file will be written with a '.new' suffix.
63 This behavior can be suppressed with the C<-force> option.
65 =head1 AUTHOR
67 Sebastian Riedel, C<sri@oook.de>
68 Maintained by the Catalyst Core Team.
70 =head1 COPYRIGHT
72 This library is free software, you can redistribute it and/or modify
73 it under the same terms as Perl itself.
75 =cut