Fix add command
authorMarius Gavrilescu <marius@ieval.ro>
Sun, 12 Apr 2015 14:27:37 +0000 (17:27 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Sun, 12 Apr 2015 14:27:37 +0000 (17:27 +0300)
lib/Gruntmaster/App/Command/Add.pm

index cc303011b298e093095e243687dcfb64c614178a..3475238621035fc85900701e1c1857c5a9e4e3e8 100644 (file)
@@ -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 {
This page took 0.011721 seconds and 4 git commands to generate.