X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FApp%2FCommand%2FAdd.pm;fp=lib%2FGruntmaster%2FApp%2FCommand%2FAdd.pm;h=3475238621035fc85900701e1c1857c5a9e4e3e8;hb=5bfe4fee59691741265842a2d06cf53a1d86aa6e;hp=cc303011b298e093095e243687dcfb64c614178a;hpb=be8bda9654c6fbf7d331288c6c25becee5f6bc7f;p=gruntmaster-data.git 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 {