~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/option.py

Add a NEWS entry and prepare submission.

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):
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: