Skip to content

Commit

Permalink
order of methods is not significant
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 14, 2015
1 parent 181a9e2 commit e4caa1b
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions lib/Mojolicious/Commands.pm
Expand Up @@ -24,21 +24,6 @@ sub detect {
return undef;
}

# Command line options for MOJO_HELP, MOJO_HOME and MOJO_MODE
sub _args {
return if __PACKAGE__->detect;

my $save
= Getopt::Long::Configure(qw(no_auto_abbrev no_ignore_case pass_through));
GetOptionsFromArray shift,
'h|help' => \$ENV{MOJO_HELP},
'home=s' => \$ENV{MOJO_HOME},
'm|mode=s' => \$ENV{MOJO_MODE};
Getopt::Long::Configure($save);
}

BEGIN { _args([@ARGV]) }

sub run {
my ($self, $name, @args) = @_;

Expand Down Expand Up @@ -90,6 +75,21 @@ sub run {

sub start_app { shift; Mojo::Server->new->build_app(shift)->start(@_) }

# Command line options for MOJO_HELP, MOJO_HOME and MOJO_MODE
sub _args {
return if __PACKAGE__->detect;

my $save
= Getopt::Long::Configure(qw(no_auto_abbrev no_ignore_case pass_through));
GetOptionsFromArray shift,
'h|help' => \$ENV{MOJO_HELP},
'home=s' => \$ENV{MOJO_HOME},
'm|mode=s' => \$ENV{MOJO_MODE};
Getopt::Long::Configure($save);
}

BEGIN { _args([@ARGV]) }

sub _command {
my ($module, $fatal) = @_;
return $module->isa('Mojolicious::Command') ? $module : undef
Expand Down

0 comments on commit e4caa1b

Please sign in to comment.