Mercurial > hg > config
changeset 249:12299cbc45ee
update this awful program
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Sat, 01 Dec 2012 17:49:12 -0800 |
parents | c7dd4631b526 |
children | 6f3d12f17847 |
files | python/randomize.py |
diffstat | 1 files changed, 8 insertions(+), 3 deletions(-) [+] |
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):