Skip to content

Commit

Permalink
fixed small Getopt::Long configuration bug in Mojolicious::Commands
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 26, 2013
1 parent 8b37afc commit d549c7f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Changes
@@ -1,8 +1,9 @@

3.83 2013-01-26
3.83 2013-01-27
- Moved bundled static files to mojo directory.
- Improved documentation.
- Improved tests.
- Fixed small Getopt::Long configuration bug in Mojolicious::Commands.

3.82 2013-01-18
- Improved documentation.
Expand Down
5 changes: 3 additions & 2 deletions lib/Mojolicious/Commands.pm
@@ -1,8 +1,7 @@
package Mojolicious::Commands;
use Mojo::Base 'Mojolicious::Command';

use Getopt::Long
qw(GetOptions :config no_auto_abbrev no_ignore_case pass_through);
use Getopt::Long 'GetOptions';
use List::Util 'max';
use Mojo::Server;

Expand Down Expand Up @@ -42,11 +41,13 @@ sub detect {

# Command line options for MOJO_HELP, MOJO_HOME and MOJO_MODE
BEGIN {
Getopt::Long::Configure(qw(no_auto_abbrev no_ignore_case pass_through));
GetOptions(
'h|help' => sub { $ENV{MOJO_HELP} = 1 },
'home=s' => sub { $ENV{MOJO_HOME} = $_[1] },
'm|mode=s' => sub { $ENV{MOJO_MODE} = $_[1] }
) unless __PACKAGE__->detect;
Getopt::Long::Configure('default');
}

sub run {
Expand Down

0 comments on commit d549c7f

Please sign in to comment.