~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/option.py

  • Committer: Jonathan Lange
  • Date: 2007-04-13 03:52:48 UTC
  • mto: This revision was merged to the branch mainline in revision 2446.
  • Revision ID: jml@canonical.com-20070413035248-l5lqpwr1t0yzp872
Provide a way of resetting list options (specifying '-' as the argument)

Show diffs side-by-side

added added

removed removed

Lines of Context:
218
218
                          *option_strings)
219
219
 
220
220
    def _optparse_callback(self, option, opt, value, parser):
221
 
        getattr(parser.values, self.name).append(self.type(value))
 
221
        values = getattr(parser.values, self.name)
 
222
        if value == '-':
 
223
            del values[:]
 
224
        else:
 
225
            values.append(self.type(value))
222
226
 
223
227
 
224
228
class RegistryOption(Option):