1 package Catalyst::Script::Create;
5 use MooseX::Types::Moose qw/Str Bool/;
6 use namespace::autoclean;
9 #extends qw(MooseX::App::Cmd);
15 traits => [qw(NoGetopt)],
21 traits => [qw(Getopt)],
22 cmd_aliases => 'nonew',
25 documentation => qq{ force new scripts }
29 traits => [qw(Getopt)],
33 documentation => qq{ display this help and exits },
37 traits => [qw(Getopt)],
41 documentation => qq{ force debug mode }
45 traits => [qw(Getopt)],
46 cmd_aliases => 'mech',
49 documentation => qq{ use WWW::Mechanize },
56 pod2usage(1) if ( $self->help || !$ARGV[0] );
58 my $helper = Catalyst::Helper->new( { '.newfiles' => !$self->force, mech => $self->mech } );
60 pod2usage(1) unless $helper->mk_component( $self->app, @ARGV );
64 __PACKAGE__->meta->make_immutable;
69 boyosplace_create.pl - Create a new Catalyst Component
73 boyosplace_create.pl [options] model|view|controller name [helper] [options]
76 -force don't create a .new file where a file to be created exists
77 -mechanize use Test::WWW::Mechanize::Catalyst for tests if available
78 -help display this help and exits
81 boyosplace_create.pl controller My::Controller
82 boyosplace_create.pl controller My::Controller BindLex
83 boyosplace_create.pl -mechanize controller My::Controller
84 boyosplace_create.pl view My::View
85 boyosplace_create.pl view MyView TT
86 boyosplace_create.pl view TT TT
87 boyosplace_create.pl model My::Model
88 boyosplace_create.pl model SomeDB DBIC::Schema MyApp::Schema create=dynamic\
90 boyosplace_create.pl model AnotherDB DBIC::Schema MyApp::Schema create=static\
91 dbi:Pg:dbname=foo root 4321
94 perldoc Catalyst::Manual
95 perldoc Catalyst::Manual::Intro
99 Create a new Catalyst Component.
101 Existing component files are not overwritten. If any of the component files
102 to be created already exist the file will be written with a '.new' suffix.
103 This behavior can be suppressed with the C<-force> option.
107 Catalyst Contributors, see Catalyst.pm
111 This library is free software, you can redistribute it and/or modify
112 it under the same terms as Perl itself.