diff python/randomize.py @ 249:12299cbc45ee

update this awful program
author Jeff Hammel <jhammel@mozilla.com>
date Sat, 01 Dec 2012 17:49:12 -0800
parents f3ab51c79813
children 08da6a1bb4c9
line wrap: on
line diff
--- a/python/randomize.py	Sat Dec 01 17:15:46 2012 -0800
+++ b/python/randomize.py	Sat Dec 01 17:49:12 2012 -0800
@@ -7,11 +7,16 @@
 
 from optparse import OptionParser
 
+"""randomize a bunch of files"""
+
 if __name__ == '__main__':
-    parser = OptionParser()
+    usage = '%prog [options] file_or_directory <...>'
+    parser = OptionParser(usage=usage, description=__doc__)
     parser.add_option("-e", "--exec", dest="callable",
-                      help="program to execute")
-    (options, argv) = parser.parse_args()
+                      help="program to execute for each file")
+    options, argv = parser.parse_args()
+    if not argv:
+        argv = ['.']
     args = []
     for i in argv:
         if os.path.isdir(i):