From: Tomas Doran Date: Thu, 10 Dec 2009 09:46:10 +0000 (+0000) Subject: Fix RT#52630 X-Git-Tag: 5.80016~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=754e86c63ffdf86b4ef862652bac878ab65a5fcf Fix RT#52630 --- diff --git a/Changes b/Changes index b0b442e..c0f84c4 100644 --- a/Changes +++ b/Changes @@ -13,6 +13,7 @@ some apache versions where %ENV{SCRIPT_NAME} is set to the real name of the script, by using $ENV{REDIRECT_URL} which contains the non-rewritten URI. + - Fix usage display when myapp_create.pl is run with no arguments. RT#52630 New features: - The __MOP__ hash element is suppressed from being dumped fully diff --git a/lib/Catalyst/Script/Create.pm b/lib/Catalyst/Script/Create.pm index 7d318fe..05b4a66 100644 --- a/lib/Catalyst/Script/Create.pm +++ b/lib/Catalyst/Script/Create.pm @@ -40,13 +40,13 @@ sub _build_helper_class { 'Catalyst::Helper' } sub run { my ($self) = @_; - $self->_exit_with_usage if !$self->ARGV->[0]; + $self->_getopt_full_usage if !$self->ARGV->[0]; my $helper_class = $self->helper_class; Class::MOP::load_class($helper_class); my $helper = $helper_class->new( { '.newfiles' => !$self->force, mech => $self->mechanize } ); - $self->_exit_with_usage unless $helper->mk_component( $self->application_name, @ARGV ); + $self->_getopt_full_usage unless $helper->mk_component( $self->application_name, @ARGV ); } diff --git a/t/aggregate/unit_core_script_create.t b/t/aggregate/unit_core_script_create.t index 588cfd5..68e2458 100644 --- a/t/aggregate/unit_core_script_create.t +++ b/t/aggregate/unit_core_script_create.t @@ -12,7 +12,7 @@ use lib "$Bin/../lib"; use Moose; extends 'Catalyst::Script::Create'; our $help; - sub _exit_with_usage { $help++ } + sub _getopt_full_usage { $help++ } } {