From 5bfe4fee59691741265842a2d06cf53a1d86aa6e Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Sun, 12 Apr 2015 17:27:37 +0300 Subject: [PATCH] Fix add command --- lib/Gruntmaster/App/Command/Add.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Gruntmaster/App/Command/Add.pm b/lib/Gruntmaster/App/Command/Add.pm index cc30301..3475238 100644 --- a/lib/Gruntmaster/App/Command/Add.pm +++ b/lib/Gruntmaster/App/Command/Add.pm @@ -24,22 +24,22 @@ use constant LEVEL_VALUES => { sub usage_desc { '%c [-cp] add id' } my %TABLE = ( - contest => \&add_contest, - problem => \&add_problem, + contests => \&add_contest, + problems => \&add_problem, ); sub validate_args { my ($self, $opt, $args) = @_; my @args = @$args; $self->usage_error('No table selected') unless $self->app->table; - $self->usage_error('Don\'t know how to add this object type') unless $TABLE{$self->app->object}; + $self->usage_error('Don\'t know how to add to this table') unless $TABLE{$self->app->table}; $self->usage_error('Wrong number of arguments') if @args != 1; } sub execute { my ($self, $opt, $args) = @_; my ($id) = @$args; - $TABLE{$self->app->object}->($self, $id); + $TABLE{$self->app->table}->($self, $id); } sub add_contest { -- 2.39.2