~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Martin
  • Date: 2010-05-16 15:18:43 UTC
  • mfrom: (5235 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5239.
  • Revision ID: gzlist@googlemail.com-20100516151843-lu53u7caehm3ie3i
Merge bzr.dev to resolve conflicts in NEWS and _chk_map_pyx

Show diffs side-by-side

added added

removed removed

Lines of Context:
222
222
    Use of all_command_names() is encouraged rather than builtin_command_names
223
223
    and/or plugin_command_names.
224
224
    """
225
 
    _register_builtin_commands()
226
225
    return builtin_command_registry.keys()
227
226
 
228
227
 
398
397
            will not mangled.
399
398
 
400
399
    :cvar hooks: An instance of CommandHooks.
401
 
    :ivar __doc__: The help shown by 'bzr help command' for this command.
402
 
        This is set by assigning explicitly to __doc__ so that -OO can
403
 
        be used::
404
 
 
405
 
        class Foo(Command):
406
 
            __doc__ = "My help goes here"
407
400
    """
408
401
    aliases = []
409
402
    takes_args = []
414
407
 
415
408
    def __init__(self):
416
409
        """Construct an instance of this command."""
 
410
        if self.__doc__ == Command.__doc__ or not self.__doc__:
 
411
            raise ValueError("No help message set for %r" % self)
417
412
        # List of standard options directly supported
418
413
        self.supported_std_options = []
419
414
        self._setup_run()
487
482
            message explaining how to obtain full help.
488
483
        """
489
484
        doc = self.help()
490
 
        if not doc:
491
 
            doc = "No help for this command."
 
485
        if doc is None:
 
486
            raise NotImplementedError(
 
487
                "self.help() returned None -  no detailed help yet for %r" %
 
488
                self.name())
492
489
 
493
490
        # Extract the summary (purpose) and sections out from the text
494
491
        purpose,sections,order = self._get_help_parts(doc)
1055
1052
        elif a == '--coverage':
1056
1053
            opt_coverage_dir = argv[i + 1]
1057
1054
            i += 1
1058
 
        elif a == '--profile-imports':
1059
 
            pass # already handled in startup script Bug #588277
1060
1055
        elif a.startswith('-D'):
1061
1056
            debug.debug_flags.add(a[2:])
1062
1057
        else: