7 defined $ENV{"MO_ROOT"} or die "Please set MO_ROOT to the contest root directory first.\n";
9 use lib $ENV{"MO_ROOT"} . "/lib/perl5";
10 use lib $ENV{"MO_ROOT"} . "/submit/lib/perl5";
16 @ARGV == 0 or die "Usage: remote-status\n";
18 my $conn = new MO::Submit;
19 $conn->connect or die $conn->{"error"} . "\n";
23 if (!defined $r) { die $conn->{"error"} . "\n"; }
24 my $err = $r->get("-");
25 if ($err) { die "$err\n"; }
28 my $r = new Sherlock::Object("!" => "STATUS");
29 $r = $conn->request($r);
31 #$r->write_indented(*STDOUT);
33 foreach my $t ($r->getarray("(T")) {
34 my $task = $t->get("T");
35 foreach my $p ($t->getarray("(P")) {
36 my $part = $p->get("P");
38 $part eq $task or $name .= "/$part";
39 printf "%-16s", $name;
41 my $current_ver = $p->get("V");
43 foreach my $v ($p->getarray("(V")) {
44 if ($v->get("V") == $current_ver) {
45 my $time = strftime("%H:%M:%S", localtime $v->get("T"));
47 "$part.", $v->get("X"), ", ",
48 $v->get("L"), " bytes, ",
49 $v->get("S"), " $time)\n";
53 $printed or print "---\n";