$extras = 0;
$alt = 0;
$merged = 0;
-$usage = "Usage: mo-score [--detail] [--alt] [--extras] [--html] [--tex] [--merged] [<directory>/]<task> ...";
+$table = 0;
+$usage = "Usage: mo-score [--detail] [--alt] [--extras] [--html] [--tex] [--table] [--merged] [<directory>/]<task> ...";
while (($arg = $ARGV[0]) =~ /^--([a-z]+)$/) {
shift @ARGV;
$var = "\$$1";
}
@ARGV || die $usage;
+$print_key = 1;
+if ($table) {
+ open STDOUT, "|column -t -s'\t'" or die;
+ $print_key = 0;
+}
+
print STDERR "Scanning contestants... ";
open (CT, "bin/mo-get-users --full |") || die "Cannot get list of contestants";
while (<CT>) {
print "\\error{TeX output not supported yet!}\n";
} else {
foreach $r (@table) { print join("\t",@$r), "\n"; }
- print "\n";
- foreach $r (sort keys %error_codes) { print "$r: $error_codes{$r}\n"; }
+ if ($print_key) {
+ print "\n";
+ foreach $r (sort keys %error_codes) { print "$r: $error_codes{$r}\n"; }
+ }
}
-
sub printHtmlRow {
print "<TR>", join('',map {
if ($hdr) { $_ = "<TH>$_"; }
} @_), "\n";
}
-
sub printHtmlHeader {
my ($perm) = @_;