]>
Commit | Line | Data |
---|---|---|
83a8a7d6 MG |
1 | #!/usr/bin/perl -w |
2 | use v5.14; | |
3 | ||
e0f96c91 | 4 | use Gruntmaster::Data; |
83a8a7d6 MG |
5 | |
6 | use IO::Prompter [ -style => 'bold', '-stdio', '-verbatim' ]; | |
7 | use File::Slurp qw/read_file/; | |
e0f96c91 | 8 | use Getopt::Long; |
83a8a7d6 MG |
9 | use Term::ANSIColor qw/RED RESET/; |
10 | use POSIX qw/strftime/; | |
11 | ||
12 | ################################################## | |
13 | ||
e0f96c91 MG |
14 | my $contest; |
15 | ||
83a8a7d6 MG |
16 | sub cmd_help{ |
17 | exec perldoc => $0 | |
18 | } | |
19 | ||
20 | sub cmd_card{ | |
e0f96c91 | 21 | say jobcard; |
83a8a7d6 MG |
22 | } |
23 | ||
24 | sub cmd_show{ | |
25 | local $_ = shift or goto &cmd_list; | |
26 | say "Date: " , strftime ('%c', localtime job_date); | |
27 | say "User: ", job_user; | |
28 | say "Problem: ", problem_name job_problem; | |
e0f96c91 | 29 | say "Extension: ", job_extension; |
83a8a7d6 MG |
30 | say "Size: ", sprintf "%.2fKB", job_filesize() / 1024; |
31 | say "Private: ", (job_private() ? 'yes' : 'no'); | |
32 | say "Result text: ", job_result_text; | |
33 | say "Daemon: ", job_daemon; | |
e0f96c91 | 34 | say "Compile errors: ", job_errors; |
83a8a7d6 MG |
35 | } |
36 | ||
37 | sub cmd_rerun{ | |
38 | local $_ = shift or goto &cmd_list; | |
39 | clean_job; | |
2b1e39b9 MG |
40 | $contest//=''; |
41 | PUBLISH jobs => "$contest.$_"; | |
83a8a7d6 MG |
42 | } |
43 | ||
44 | ################################################## | |
45 | ||
e0f96c91 MG |
46 | GetOptions ( 'contest=s' => \$contest ); |
47 | local $Gruntmaster::Data::contest = $contest; | |
83a8a7d6 MG |
48 | my $cmd = 'cmd_' . shift; |
49 | cmd_help unless exists $main::{$cmd}; | |
e0f96c91 | 50 | no strict 'refs'; |
83a8a7d6 MG |
51 | $cmd->(@ARGV) if exists $main::{$cmd}; |
52 | ||
53 | 1; | |
54 | __END__ | |
55 | ||
56 | =encoding utf-8 | |
57 | ||
58 | =head1 NAME | |
59 | ||
60 | gruntmaster-job - shell interface to Gruntmaster 6000 job log | |
61 | ||
62 | =head1 SYNOPSIS | |
63 | ||
64 | gruntmaster-job card | |
65 | gruntmaster-job show 5 | |
66 | gruntmaster-job rerun 7 | |
67 | ||
68 | =head1 DESCRIPTION | |
69 | ||
70 | ||
71 | ||
72 | =cut |