From: Vincent Pit Date: Sun, 5 Oct 2008 21:30:44 +0000 (+0200) Subject: Set fallback command in App::Rgit::Command instead of App::Rgit X-Git-Tag: v0.02~10 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Frgit.git;a=commitdiff_plain;h=f34c972acf43aff431228979855d39fbd7c52faf Set fallback command in App::Rgit::Command instead of App::Rgit --- diff --git a/lib/App/Rgit.pm b/lib/App/Rgit.pm index f84d445..d2fe602 100644 --- a/lib/App/Rgit.pm +++ b/lib/App/Rgit.pm @@ -51,7 +51,7 @@ sub new { $class->SUPER::new( config => $config, command => App::Rgit::Command->new( - cmd => $args{cmd} || ' ', + cmd => $args{cmd}, args => $args{args}, repos => $config->repos, ) diff --git a/lib/App/Rgit/Command.pm b/lib/App/Rgit/Command.pm index b32095f..7410be7 100644 --- a/lib/App/Rgit/Command.pm +++ b/lib/App/Rgit/Command.pm @@ -42,7 +42,7 @@ __PACKAGE__->action($_ => 'Once') for qw/version help daemon init/, ' '; sub new { my ($class, %args) = &validate; my $cmd = $args{cmd}; - return unless defined $cmd; + $cmd = ' ' unless defined $cmd; my $action = $class->action($cmd); croak "Command $cmd shouldn't be executed as an $action" unless $class eq __PACKAGE__ or $class->isa($action);