X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=mop%2Feval%2Fmo-score.sh;h=9d0a200ec13f29e72669b848d1bce8ffa5dc2dad;hb=32a38f82fff9cf1098f68a2b9ada9f9e0f98fdd6;hp=9ed73f4a2cb8f144a08d2330dea88553f550ea97;hpb=b6013d244489aca80a904755ec2531874361185c;p=moe.git diff --git a/mop/eval/mo-score.sh b/mop/eval/mo-score.sh index 9ed73f4..9d0a200 100755 --- a/mop/eval/mo-score.sh +++ b/mop/eval/mo-score.sh @@ -8,7 +8,8 @@ $tex = 0; $extras = 0; $alt = 0; $merged = 0; -$usage = "Usage: mo-score [--detail] [--alt] [--extras] [--html] [--tex] [--merged] [/] ..."; +$table = 0; +$usage = "Usage: mo-score [--detail] [--alt] [--extras] [--html] [--tex] [--table] [--merged] [/] ..."; while (($arg = $ARGV[0]) =~ /^--([a-z]+)$/) { shift @ARGV; $var = "\$$1"; @@ -17,6 +18,12 @@ while (($arg = $ARGV[0]) =~ /^--([a-z]+)$/) { } @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 () { @@ -219,11 +226,12 @@ if ($debug) { 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 "", join('',map { if ($hdr) { $_ = "$_"; } @@ -231,7 +239,6 @@ sub printHtmlRow { } @_), "\n"; } - sub printHtmlHeader { my ($perm) = @_;