]>
Commit | Line | Data |
---|---|---|
1 | #!/usr/bin/perl -w | |
2 | use v5.14; | |
3 | ||
4 | use Gruntmaster::Data; | |
5 | ||
6 | use IO::Prompter [ -style => 'bold', '-stdio', '-verbatim' ]; | |
7 | use File::Slurp qw/read_file/; | |
8 | use Getopt::Long; | |
9 | use Term::ANSIColor qw/RED RESET/; | |
10 | use POSIX qw/strftime/; | |
11 | ||
12 | ################################################## | |
13 | ||
14 | my $contest; | |
15 | ||
16 | sub cmd_help{ | |
17 | exec perldoc => $0 | |
18 | } | |
19 | ||
20 | sub cmd_card{ | |
21 | say jobcard; | |
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; | |
29 | say "Extension: ", job_extension; | |
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; | |
34 | say "Compile errors: ", job_errors; | |
35 | } | |
36 | ||
37 | sub cmd_rerun{ | |
38 | local $_ = shift or goto &cmd_list; | |
39 | clean_job; | |
40 | PUBLISH jobs => $_; | |
41 | } | |
42 | ||
43 | ################################################## | |
44 | ||
45 | GetOptions ( 'contest=s' => \$contest ); | |
46 | local $Gruntmaster::Data::contest = $contest; | |
47 | my $cmd = 'cmd_' . shift; | |
48 | cmd_help unless exists $main::{$cmd}; | |
49 | no strict 'refs'; | |
50 | $cmd->(@ARGV) if exists $main::{$cmd}; | |
51 | ||
52 | 1; | |
53 | __END__ | |
54 | ||
55 | =encoding utf-8 | |
56 | ||
57 | =head1 NAME | |
58 | ||
59 | gruntmaster-job - shell interface to Gruntmaster 6000 job log | |
60 | ||
61 | =head1 SYNOPSIS | |
62 | ||
63 | gruntmaster-job card | |
64 | gruntmaster-job show 5 | |
65 | gruntmaster-job rerun 7 | |
66 | ||
67 | =head1 DESCRIPTION | |
68 | ||
69 | ||
70 | ||
71 | =cut |