]> git.donarmstrong.com Git - debian-ctte.git/blobdiff - scripts/pocket-devotee
Add aba, and conclude
[debian-ctte.git] / scripts / pocket-devotee
index 5fb9fdcd48daff9cf94ea9350716a45065a4d2de..e806ba0a71ffe14022752932f78b68c8a7b3c9ee 100755 (executable)
@@ -184,6 +184,8 @@ sub winner {
   if (not defined $params{tally_fh}) {
       $params{tally_fh} = \*STDIN;
   }
+  # header been output?
+  my $header_output = 0;
 
   # This is where we get our input data from
   while (defined ($_ = $params{tally_fh}->getline)) {
@@ -218,6 +220,10 @@ sub winner {
           for my $opt (@options) {
               $vote .= exists $option_rank{$opt->{key}} ? $number_to_option{$option_rank{$opt->{key}}} : '-';
           }
+          if (not $header_output) {
+              print {$RESULTS} "/--".join("",map {$_->{key}} @options)."\n";
+              $header_output = 1;
+          }
           print {$RESULTS} "V: $vote $voter\n";
 
       } else {
@@ -279,7 +285,7 @@ EOF
       printf {$RESULTS} "Option %s  ", $order_to_options{$row + 1}{key};
       for my $col (0..($max_choices - 1)) {
           if ($row == $col) {
-              printf {$RESULTS} "      ", $Beat_Matrix[$row][$col];
+              print {$RESULTS} "      ";
           } else {
               printf {$RESULTS} " % 4d ", $Beat_Matrix[$row][$col];
           }