aboutsummaryrefslogtreecommitdiffstats
path: root/script/mga_mirrors_create.pl
diff options
context:
space:
mode:
Diffstat (limited to 'script/mga_mirrors_create.pl')
-rwxr-xr-xscript/mga_mirrors_create.pl47
1 files changed, 36 insertions, 11 deletions
diff --git a/script/mga_mirrors_create.pl b/script/mga_mirrors_create.pl
index f527390..8229a0f 100755
--- a/script/mga_mirrors_create.pl
+++ b/script/mga_mirrors_create.pl
@@ -2,9 +2,37 @@
use strict;
use warnings;
+use Getopt::Long;
+use Pod::Usage;
+eval "use Catalyst::Helper;";
-use Catalyst::ScriptRunner;
-Catalyst::ScriptRunner->run('MGA::Mirrors', 'Create');
+if ($@) {
+ die <<END;
+To use the Catalyst development tools including catalyst.pl and the
+generated script/myapp_create.pl you need Catalyst::Helper, which is
+part of the Catalyst-Devel distribution. Please install this via a
+vendor package or by running one of -
+
+ perl -MCPAN -e 'install Catalyst::Devel'
+ perl -MCPANPLUS -e 'install Catalyst::Devel'
+END
+}
+
+my $force = 0;
+my $mech = 0;
+my $help = 0;
+
+GetOptions(
+ 'nonew|force' => \$force,
+ 'mech|mechanize' => \$mech,
+ 'help|?' => \$help
+ );
+
+pod2usage(1) if ( $help || !$ARGV[0] );
+
+my $helper = Catalyst::Helper->new( { '.newfiles' => !$force, mech => $mech } );
+
+pod2usage(1) unless $helper->mk_component( 'MGA::Mirrors', @ARGV );
1;
@@ -17,28 +45,25 @@ mga_mirrors_create.pl - Create a new Catalyst Component
mga_mirrors_create.pl [options] model|view|controller name [helper] [options]
Options:
- --force don't create a .new file where a file to be created exists
- --mechanize use Test::WWW::Mechanize::Catalyst for tests if available
- --help display this help and exits
+ -force don't create a .new file where a file to be created exists
+ -mechanize use Test::WWW::Mechanize::Catalyst for tests if available
+ -help display this help and exits
Examples:
mga_mirrors_create.pl controller My::Controller
mga_mirrors_create.pl -mechanize controller My::Controller
mga_mirrors_create.pl view My::View
- mga_mirrors_create.pl view HTML TT
+ mga_mirrors_create.pl view MyView TT
+ mga_mirrors_create.pl view TT TT
mga_mirrors_create.pl model My::Model
mga_mirrors_create.pl model SomeDB DBIC::Schema MyApp::Schema create=dynamic\
dbi:SQLite:/tmp/my.db
mga_mirrors_create.pl model AnotherDB DBIC::Schema MyApp::Schema create=static\
- [Loader opts like db_schema, naming] dbi:Pg:dbname=foo root 4321
- [connect_info opts like quote_char, name_sep]
+ dbi:Pg:dbname=foo root 4321
See also:
perldoc Catalyst::Manual
perldoc Catalyst::Manual::Intro
- perldoc Catalyst::Helper::Model::DBIC::Schema
- perldoc Catalyst::Model::DBIC::Schema
- perldoc Catalyst::View::TT
=head1 DESCRIPTION