X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=gruntmaster-job;h=7adab69797a5ab43e7d5e9a5b1330d7399406662;hb=d17951d1fd99fc1ed82cb900b8fff7091971e59b;hp=b454ad43f352c9954fa826030dfde35ba4bf3a92;hpb=83a8a7d6035372ef9d8e78fb46742f7bf2a3a1ca;p=plack-app-gruntmaster.git diff --git a/gruntmaster-job b/gruntmaster-job index b454ad4..7adab69 100755 --- a/gruntmaster-job +++ b/gruntmaster-job @@ -1,22 +1,24 @@ #!/usr/bin/perl -w use v5.14; -use Gruntmaster::Data qw/jobcard job_date job_user job_problem job_filesize job_private job_result_text job_daemon clean_job problem_name PUBLISH HDEL/; +use Gruntmaster::Data; use IO::Prompter [ -style => 'bold', '-stdio', '-verbatim' ]; use File::Slurp qw/read_file/; +use Getopt::Long; use Term::ANSIColor qw/RED RESET/; use POSIX qw/strftime/; ################################################## +my $contest; + sub cmd_help{ exec perldoc => $0 } sub cmd_card{ - my $contest = shift; - print jobcard; + say jobcard; } sub cmd_show{ @@ -24,23 +26,28 @@ sub cmd_show{ say "Date: " , strftime ('%c', localtime job_date); say "User: ", job_user; say "Problem: ", problem_name job_problem; + say "Extension: ", job_extension; say "Size: ", sprintf "%.2fKB", job_filesize() / 1024; say "Private: ", (job_private() ? 'yes' : 'no'); say "Result text: ", job_result_text; say "Daemon: ", job_daemon; + say "Compile errors: ", job_errors; } sub cmd_rerun{ local $_ = shift or goto &cmd_list; clean_job; - PUBLISH jobs => $_; + $contest//=''; + PUBLISH jobs => "$contest.$_"; } ################################################## -no strict 'refs'; +GetOptions ( 'contest=s' => \$contest ); +local $Gruntmaster::Data::contest = $contest; my $cmd = 'cmd_' . shift; cmd_help unless exists $main::{$cmd}; +no strict 'refs'; $cmd->(@ARGV) if exists $main::{$cmd}; 1;