]> gitweb.pimeys.fr Git - scripts-20-100.git/blobdiff - ftp/percent_decode.py
percent_decode quitte sans hold + option pour --follow
[scripts-20-100.git] / ftp / percent_decode.py
index 8fc51c9ef58e1f2c6ec9c64656522e9f74fab931..5621e3f5ced533d2ea0e34d2429e67e8ce52431e 100755 (executable)
@@ -16,13 +16,20 @@ import time
 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