~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/option.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-02-23 17:00:36 UTC
  • mfrom: (4032.1.4 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090223170036-3q1v68ewdt8i0to5
(Marius Kruger) Remove all trailing whitespace and add tests to
        enforce this.

Show diffs side-by-side

added added

removed removed

Lines of Context:
136
136
 
137
137
class Option(object):
138
138
    """Description of a command line option
139
 
    
 
139
 
140
140
    :ivar _short_name: If this option has a single-letter name, this is it.
141
141
    Otherwise None.
142
142
    """
154
154
        """Make a new command option.
155
155
 
156
156
        :param name: regular name of the command, used in the double-dash
157
 
            form and also as the parameter to the command's run() 
 
157
            form and also as the parameter to the command's run()
158
158
            method (unless param_name is specified).
159
159
 
160
160
        :param help: help message displayed in command help
161
161
 
162
 
        :param type: function called to parse the option argument, or 
 
162
        :param type: function called to parse the option argument, or
163
163
            None (default) if this option doesn't take an argument.
164
164
 
165
165
        :param argname: name of option argument, if any
241
241
 
242
242
    def iter_switches(self):
243
243
        """Iterate through the list of switches provided by the option
244
 
        
 
244
 
245
245
        :return: an iterator of (name, short_name, argname, help)
246
246
        """
247
247
        argname =  self.argname
349
349
        if self._registry is None:
350
350
            self._registry = self._lazy_registry.get_obj()
351
351
        return self._registry
352
 
    
 
352
 
353
353
    @staticmethod
354
354
    def from_kwargs(name_, help=None, title=None, value_switches=False,
355
355
                    enum_switch=True, **kwargs):