view makeitso/python_module/{{module}}.py @ 159:cfd4f1e91090

wip
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 30 Jul 2013 15:20:38 -0700
parents ebc5cfe17d95
children
line wrap: on
line source

#!/usr/bin/env python

"""
{{module}}
{{description}}
"""

import optparse
import sys

def add_options(parser):
    """add {{module}} options to an OptionParser instance"""


def main(args=sys.argv[1:]):

    # parse command line arguments
    usage = '%prog [options] ...'
    class PlainDescriptionFormatter(optparse.IndentedHelpFormatter):
        """description formatter"""
        def format_description(self, description):
            if description:
                return description.strip() + '\n'
            else:
                return ''
    parser = optparse.OptionParser(usage=usage, description=__doc__, formatter=PlainDescriptionFormatter())
    add_options(parser)
    options, args = parser.parse_args(args)

if __name__ == '__main__':
    main()