~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-05-11 15:04:00 UTC
  • mfrom: (5221.2.1 command-help-bug-177500)
  • Revision ID: pqm@pqm.ubuntu.com-20100511150400-7euir3548ln55n7s
(lifeless) Fail to construct commands that have no help,
 rather than failing when help is first requested. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
407
407
 
408
408
    def __init__(self):
409
409
        """Construct an instance of this command."""
410
 
        if self.__doc__ == Command.__doc__:
411
 
            warn("No help message set for %r" % self)
 
410
        if self.__doc__ == Command.__doc__ or not self.__doc__:
 
411
            raise ValueError("No help message set for %r" % self)
412
412
        # List of standard options directly supported
413
413
        self.supported_std_options = []
414
414
        self._setup_run()
483
483
        """
484
484
        doc = self.help()
485
485
        if doc is None:
486
 
            raise NotImplementedError("sorry, no detailed help yet for %r" % self.name())
 
486
            raise NotImplementedError(
 
487
                "self.help() returned None -  no detailed help yet for %r" %
 
488
                self.name())
487
489
 
488
490
        # Extract the summary (purpose) and sections out from the text
489
491
        purpose,sections,order = self._get_help_parts(doc)