~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 01:15:12 UTC
  • mto: This revision was merged to the branch mainline in revision 2441.
  • Revision ID: robertc@robertcollins.net-20070420011512-wralvwk6y8esm83c
Remove duplication by using the new help infrastructure for topic output.

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
 
    if topic is None:
41
 
        topic = 'basic'
42
 
 
43
 
    if topic in help_topics.topic_registry:
44
 
        txt = help_topics.topic_registry.get_detail(topic)
45
 
        outfile.write(txt)
 
40
    topic_context = help_topics.HelpTopicContext()
 
41
    topics = topic_context.get_topics(topic)
 
42
    if topics:
 
43
        outfile.write(topics[0].get_help_text())
46
44
    else:
47
45
        help_on_command(topic, outfile=outfile)
48
46