Permalink
Browse files

Voting! Just run ...vote

  • Loading branch information...
rking authored and rkingpa@sharpsaw.org committed Feb 16, 2013
1 parent d69768b commit 192b9fa7c2601f7097d1e96d8b1387b0adae2579
Showing with 26 additions and 0 deletions.
  1. +21 −0 bin/show-votes
  2. +5 −0 lib/scripting
View
@@ -0,0 +1,21 @@
+#!/usr/bin/perl -n -0400
+if (s/.*VOTE:\s*(.*?)#?\s*:ETOV/$1/s) {
+ my @lines = map {
+ if (/s(?:ays|ez):?\s*(\w*)/) {
+ my $answer = $1;
+ my $color;
+ if ($anwser =~ /^y/i) {
+ $color = 32
+ } elsif ($answer =~ /^no/i) {
+ $color = 31
+ } elsif ($answer) {
+ $color = 36
+ } else {
+ $color = 35
+ }
+ $_ = "\e[${color}m$_\e[0m";
+ }
+ "$_\n"
+ } split /\n/, $1;
+ print qq{\e[34;1m`pwd`/$ARGV\e[0m\n@lines}
+}
View
@@ -118,4 +118,9 @@ alias sourceif=...sourceif # Backwards compatibility.
)
fi
}
+
+...vote() {
+ ...quieteach 'git ls-files | xargs show-votes'
+}
+
# vim:ft=zsh

0 comments on commit 192b9fa

Please sign in to comment.