]> git.donarmstrong.com Git - debian-ctte.git/commitdiff
include the options when outputing the tally sheet
authorDon Armstrong <don@donarmstrong.com>
Mon, 27 Apr 2015 18:44:59 +0000 (11:44 -0700)
committerDon Armstrong <don@donarmstrong.com>
Mon, 27 Apr 2015 18:44:59 +0000 (11:44 -0700)
scripts/pocket-devotee

index 5fb9fdcd48daff9cf94ea9350716a45065a4d2de..e2e667880c277ac65a0b83ef35f4ce9251189ff2 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 {