Commits

sp...@localhost  committed 1985222
  • Participants

Comments (0)

Files changed (1)

  • +16 -0
    gb
+#!/usr/bin/env python -u
+
+import sys
+
+try:
+   pat = sys.argv[1]
+except IndexError:
+   pat = None
+
+green = True
+for line in iter(sys.stdin.readline, ""):
+    if (pat and pat in line) or (not pat and green):
+        print "\x1b[7m%s\x1b[0m" % line.rstrip()
+    else:
+        print line,
+    green = not green