annotate makeitso/cli.py @ 57:074a32920f7c

stub for a command-line parser
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 06 Jan 2011 14:27:09 -0800
parents
children 112bf081148c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
57
074a32920f7c stub for a command-line parser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
1 """
074a32920f7c stub for a command-line parser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2 command line parser for MakeItSo
074a32920f7c stub for a command-line parser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
3 """
074a32920f7c stub for a command-line parser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
4
074a32920f7c stub for a command-line parser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
5 from optparse import OptionParser
074a32920f7c stub for a command-line parser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
6
074a32920f7c stub for a command-line parser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
7 def parser(template):
074a32920f7c stub for a command-line parser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
8 """
074a32920f7c stub for a command-line parser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
9 return a command line parser for the template
074a32920f7c stub for a command-line parser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
10 """
074a32920f7c stub for a command-line parser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
11 usage = '%prog [options]'
074a32920f7c stub for a command-line parser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
12 description = getattr(template, 'description', None)
074a32920f7c stub for a command-line parser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
13 parser = OptionParser(usage=usage, description=description)
074a32920f7c stub for a command-line parser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
14 return parser
074a32920f7c stub for a command-line parser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
15