Fix duplicate short options issue
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Script / Create.pm
index 575f9e7..47965a6 100644 (file)
@@ -6,6 +6,8 @@ use namespace::autoclean;
 
 with 'Catalyst::ScriptRole';
 
+has '+help' => (cmd_aliases => 'h');
+
 has force => (
     traits => [qw(Getopt)],
     cmd_aliases => 'nonew',
@@ -33,7 +35,7 @@ has mechanize => (
 sub run {
     my ($self) = @_;
 
-    $self->_display_help if ( !$ARGV[0] );
+    $self->_exit_with_usage if !$ARGV[0];
 
     my $helper = Catalyst::Helper->new( { '.newfiles' => !$self->force, mech => $self->mech } );
 
@@ -42,7 +44,6 @@ sub run {
 }
 
 __PACKAGE__->meta->make_immutable;
-1;
 
 =head1 NAME
 
@@ -92,3 +93,4 @@ This library is free software, you can redistribute it and/or modify
 it under the same terms as Perl itself.
 
 =cut
+