red="\e[1;31m"
nocolor="\e[0m"
+FOLLOW = False
+if "-f" in sys.argv:
+ FOLLOW = True
+
+run = True
try:
- while True:
+ while run:
l = sys.stdin.readline()
if l != "":
l = urllib.unquote(l)
if "--color" in sys.argv:
l = l.replace('"PUT ', '"%sPUT%s ' % (red, nocolor))
sys.stdout.write(l)
+ elif not FOLLOW:
+ run = False
except KeyboardInterrupt:
pass