~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/option.py

  • Committer: Martin Pool
  • Date: 2010-04-01 04:41:18 UTC
  • mto: This revision was merged to the branch mainline in revision 5128.
  • Revision ID: mbp@sourcefrog.net-20100401044118-shyctqc02ob08ngz
ignore .testrepository

Show diffs side-by-side

added added

removed removed

Lines of Context:
276
276
        parser.add_option(action='callback',
277
277
                          callback=self._optparse_callback,
278
278
                          type='string', metavar=self.argname.upper(),
279
 
                          help=self.help, dest=self._param_name, default=[],
 
279
                          help=self.help, default=[],
280
280
                          *option_strings)
281
281
 
282
282
    def _optparse_callback(self, option, opt, value, parser):
364
364
        as values for the option, and their value is treated as the help.
365
365
        """
366
366
        reg = _mod_registry.Registry()
367
 
        for name, switch_help in sorted(kwargs.items()):
 
367
        for name, switch_help in kwargs.iteritems():
368
368
            name = name.replace('_', '-')
369
369
            reg.register(name, name, help=switch_help)
370
370
            if not value_switches: