Mercurial > hg > lockedfile
diff lockedfile/main.py @ 0:c8c2d98afc98
initial commit (stub)
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Sun, 18 Mar 2012 20:37:19 -0700 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lockedfile/main.py Sun Mar 18 20:37:19 2012 -0700 @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +""" +locked file implementation +""" + +import sys +import optparse + +def main(args=sys.argv[:]): + + # parse command line options + usage = '%prog [options]' + class PlainDescriptionFormatter(optparse.IndentedHelpFormatter): + """description formatter for console script entry point""" + def format_description(self, description): + if description: + return description + '\n' + else: + return '' + parser = optparse.OptionParser(usage=usage, description=__doc__, formatter=PlainDescriptionFormatter()) + options, args = parser.parse_args(args) + +if __name__ == '__main__': + main() +