~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Robert Collins
  • Date: 2007-04-18 08:39:02 UTC
  • mto: (2425.1.2 integration)
  • mto: This revision was merged to the branch mainline in revision 2427.
  • Revision ID: robertc@robertcollins.net-20070418083902-4o66h9fk7zeisvwa
Command objects can now declare related help topics by having _see_also
set to a list of related topic. Updated the HACKING guide entry on
documentation to be more clear about how the help for commands is
generated and to reference this new feature. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
233
233
        if self.__doc__ == Command.__doc__:
234
234
            warn("No help message set for %r" % self)
235
235
 
 
236
    def get_see_also(self):
 
237
        """Return a list of help topics that are related to this ommand.
 
238
        
 
239
        The list is derived from the content of the _see_also attribute. Any
 
240
        duplicates are removed and the result is in lexical order.
 
241
        :return: A list of help topics.
 
242
        """
 
243
        return sorted(set(getattr(self, '_see_also', [])))
 
244
 
236
245
    def options(self):
237
246
        """Return dict of valid options for this command.
238
247