]> iEval git - gruntmaster-data.git/blobdiff - lib/Gruntmaster/App/Command/Add.pm
Add missing read_file
[gruntmaster-data.git] / lib / Gruntmaster / App / Command / Add.pm
index cc303011b298e093095e243687dcfb64c614178a..a8306758d514c613fc9dccd5128389b6333e102a 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 {
@@ -89,7 +89,7 @@ sub add_problem {
 
        if ($runner eq 'Verifier' || $runner eq 'Interactive') {
                say RED, 'WARNING: Runner::Interactive is experimental', RESET if $runner eq 'Interactive';
-               $versource = prompt "[Runner::$runner] Verifier file name", -complete => 'filenames';
+               $versource = read_file prompt "[Runner::$runner] Verifier file name", -complete => 'filenames';
                $verformat = prompt "[Runner::$runner] Verifier format", -menu => [qw/C CPP MONO JAVA PASCAL PERL PYTHON/];
        }
 
This page took 0.0187 seconds and 4 git commands to generate.