]> granicus.if.org Git - python/commitdiff
Detlef Lannert lannert@lannert.rz.uni-duesseldorf.de notices:
authorGuido van Rossum <guido@python.org>
Tue, 20 Oct 1998 15:33:33 +0000 (15:33 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 20 Oct 1998 15:33:33 +0000 (15:33 +0000)
"""
the NEWS file of Python 1.5.2a2 inspired me to look at
Tools/scripts/untabify.py. I wonder why it accepts a -t argument
but ignores it. The following patch tries to make it somewhat useful
(i.e., to override the tabsize=8 setting). Is that agreeable?
"""

Tools/scripts/untabify.py

index 1f74973ad7a94e58215f8b4e4d55aed0b91e3c1e..7be9f38420b485fde285aa866394c71172e24fa3 100755 (executable)
@@ -15,8 +15,11 @@ def main():
             raise getopt.error, "At least one file argument required"
     except getopt.error, msg:
         print msg
-        print "usage:", sys.argv[0], "file ..."
+        print "usage:", sys.argv[0], "[-t tabwidth] file ..."
         return
+    for optname, optvalue in opts:
+        if optname == '-t':
+            tabsize = int(optvalue)
 
     for file in args:
         process(file, tabsize)