~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/help.py

  • Committer: Robert Collins
  • Date: 2007-04-20 02:32:10 UTC
  • mto: This revision was merged to the branch mainline in revision 2441.
  • Revision ID: robertc@robertcollins.net-20070420023210-tqvs66j9cucmm7li
Switch help.help to using HelpContexts completely, fixing bug 107656.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
    if outfile is None:
38
38
        outfile = sys.stdout
39
39
 
40
 
    topic_context = help_topics.HelpTopicContext()
41
 
    topics = topic_context.get_topics(topic)
42
 
    if topics:
43
 
        outfile.write(topics[0].get_help_text())
44
 
    else:
45
 
        cmdname = str(topic)
46
 
        cmd_object = _mod_commands.get_cmd_object(cmdname)
47
 
        outfile.write(cmd_object.get_help_text())
 
40
    contexts = HelpContexts()
 
41
    topics = contexts.search(topic)
 
42
    outfile.write(topics[0].get_help_text())
48
43
 
49
44
 
50
45
def help_commands(outfile=None):