1 package Catalyst::Script::Create;
6 use MooseX::Types::Moose qw/Str/;
7 use namespace::autoclean;
9 has app => (isa => Str, is => 'ro', required => 1);
11 sub new_with_options { shift->new(@_) }
20 'nonew|force' => \$force,
21 'mech|mechanize' => \$mech,
25 pod2usage(1) if ( $help || !$ARGV[0] );
27 my $helper = Catalyst::Helper->new( { '.newfiles' => !$force, mech => $mech } );
29 pod2usage(1) unless $helper->mk_component( $self->app, @ARGV );
37 boyosplace_create.pl - Create a new Catalyst Component
41 boyosplace_create.pl [options] model|view|controller name [helper] [options]
44 -force don't create a .new file where a file to be created exists
45 -mechanize use Test::WWW::Mechanize::Catalyst for tests if available
46 -help display this help and exits
49 boyosplace_create.pl controller My::Controller
50 boyosplace_create.pl controller My::Controller BindLex
51 boyosplace_create.pl -mechanize controller My::Controller
52 boyosplace_create.pl view My::View
53 boyosplace_create.pl view MyView TT
54 boyosplace_create.pl view TT TT
55 boyosplace_create.pl model My::Model
56 boyosplace_create.pl model SomeDB DBIC::Schema MyApp::Schema create=dynamic\
58 boyosplace_create.pl model AnotherDB DBIC::Schema MyApp::Schema create=static\
59 dbi:Pg:dbname=foo root 4321
62 perldoc Catalyst::Manual
63 perldoc Catalyst::Manual::Intro
67 Create a new Catalyst Component.
69 Existing component files are not overwritten. If any of the component files
70 to be created already exist the file will be written with a '.new' suffix.
71 This behavior can be suppressed with the C<-force> option.
75 Catalyst Contributors, see Catalyst.pm
79 This library is free software, you can redistribute it and/or modify
80 it under the same terms as Perl itself.