Skip to content

Commit

Permalink
fixed bug that prevented --help and -h flags from working for generat…
Browse files Browse the repository at this point in the history
…or commands
  • Loading branch information
kraih committed Apr 8, 2012
1 parent 64552e2 commit 16d07cb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Changes
Expand Up @@ -3,6 +3,8 @@ This file documents the revision history for Perl extension Mojolicious.
2.77 2012-04-08
- Improved documentation. (tempire, sri)
- Improved tests.
- Fixed bug that prevented --help and -h flags from working for generator
commands.
- Fixed small bug that prevented non-string secrets in Mojolicious.

2.76 2012-04-05
Expand Down
10 changes: 9 additions & 1 deletion lib/Mojolicious/Command/generate.pm
Expand Up @@ -16,6 +16,8 @@ has namespaces =>
sub { [qw/Mojolicious::Command::generate Mojo::Command::generate/] };
has usage => "usage: $0 generate GENERATOR [OPTIONS]\n";

sub help { shift->run(@_) }

1;
__END__
Expand Down Expand Up @@ -71,7 +73,13 @@ L<Mojolicious::Command::generate> and L<Mojo::Command::generate>.
=head1 METHODS
L<Mojolicious::Command::generate> inherits all methods from
L<Mojolicious::Commands>.
L<Mojolicious::Commands> and implements the following new ones.
=head2 C<help>
$generator->help('app');
Print usage information for generator command.
=head1 SEE ALSO
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Commands.pm
Expand Up @@ -77,7 +77,7 @@ sub run {
unless $module;

# Run
return $help ? $module->new->help : $module->new->run(@args);
return $help ? $module->new->help(@args) : $module->new->run(@args);
}

# Test
Expand Down

0 comments on commit 16d07cb

Please sign in to comment.