~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/option.py

  • Committer: Jonathan Lange
  • Date: 2007-04-17 07:59:42 UTC
  • mto: This revision was merged to the branch mainline in revision 2446.
  • Revision ID: jml@canonical.com-20070417075942-1vfzpwjf8rvbty1f
Variety of whitespace cleanups, tightening of tests and docstring changes in
response to review of bug support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
206
206
 
207
207
 
208
208
class ListOption(Option):
 
209
    """Option used to provide a list of values.
 
210
 
 
211
    On the command line, arguments are specified by a repeated use of the
 
212
    option. '-' is a special argument that resets the list. For example,
 
213
      --foo=a --foo=b
 
214
    sets the value of the 'foo' option to ['a', 'b'], and
 
215
      --foo=a --foo=b --foo=- --foo=c
 
216
    sets the value of the 'foo' option to ['c'].
 
217
    """
 
218
 
209
219
    def add_option(self, parser, short_name):
210
220
        """Add this option to an Optparse parser."""
211
221
        option_strings = ['--%s' % self.name]