Mercurial > hg > MakeItSo
comparison makeitso/cli.py @ 122:b2152efec89a
get the description from the docstring if applicable
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Wed, 19 Jan 2011 18:24:58 -0800 |
parents | d28cde6c942e |
children | aed8c4af5f26 |
comparison
equal
deleted
inserted
replaced
121:d28cde6c942e | 122:b2152efec89a |
---|---|
14 def parser(self): | 14 def parser(self): |
15 """ | 15 """ |
16 return a command line parser for the template | 16 return a command line parser for the template |
17 """ | 17 """ |
18 usage = getattr(self, 'usage', '%prog [options] output') | 18 usage = getattr(self, 'usage', '%prog [options] output') |
19 description = getattr(self.template_class, 'description', None) | 19 description = self.template_class.get_description() |
20 parser = OptionParser(usage=usage, description=description) | 20 parser = OptionParser(usage=usage, description=description) |
21 | 21 |
22 # add the variables as options | 22 # add the variables as options |
23 for variable in self.template_class.vars: | 23 for variable in self.template_class.vars: |
24 description = variable.description | 24 description = variable.description |