Skip to content

Commit

Permalink
made command system slightly smarter
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jun 22, 2012
1 parent 22c6a55 commit dd82fb9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Mojolicious/Commands.pm
Expand Up @@ -68,7 +68,7 @@ sub run {

# Try all namespaces
my $module;
$module = _command("${_}::$name") and last for @{$self->namespaces};
$module = _command("${_}::$name", 1) and last for @{$self->namespaces};

# Unknown command
die qq{Unknown command "$name", maybe you need to install it?\n}
Expand Down Expand Up @@ -124,10 +124,10 @@ sub start_app {
}

sub _command {
my $module = shift;
my ($module, $fatal) = @_;
return $module->isa('Mojolicious::Command') ? $module : undef
unless my $e = Mojo::Loader->load($module);
warn $e if ref $e;
$fatal ? die $e : warn $e if ref $e;
return;
}

Expand Down

0 comments on commit dd82fb9

Please sign in to comment.