~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/option.py

  • Committer: John Arbash Meinel
  • Date: 2009-12-15 19:59:00 UTC
  • mfrom: (4634.108.2 2.0)
  • mto: This revision was merged to the branch mainline in revision 4900.
  • Revision ID: john@arbash-meinel.com-20091215195900-fvgxdv9ycbrnzp1o
merge the 2.0.4 branch into 2.1.0b5

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2010 Canonical Ltd
 
1
# Copyright (C) 2004, 2005, 2006, 2007 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
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):
361
361
 
362
362
        name, help, value_switches and enum_switch are passed to the
363
363
        RegistryOption constructor.  Any other keyword arguments are treated
364
 
        as values for the option, and their value is treated as the help.
 
364
        as values for the option, and they 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: