~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/help.py

  • Committer: Alexander Belchenko
  • Date: 2007-08-10 09:04:38 UTC
  • mto: This revision was merged to the branch mainline in revision 2694.
  • Revision ID: bialix@ukr.net-20070810090438-0835xdz0rl8825qv
fixes after Ian's review

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
        outfile = sys.stdout
41
41
 
42
42
    indices = HelpIndices()
43
 
 
44
 
    alias = _mod_commands.get_alias(topic)
45
 
    try:
46
 
        topics = indices.search(topic)
47
 
        shadowed_terms = []
48
 
        for index, topic in topics[1:]:
49
 
            shadowed_terms.append('%s%s' % (index.prefix,
50
 
                topic.get_help_topic()))
51
 
        outfile.write(topics[0][1].get_help_text(shadowed_terms))
52
 
    except errors.NoHelpTopic:
53
 
        if alias is None:
54
 
            raise
55
 
 
56
 
    if alias is not None:
57
 
        outfile.write("'bzr %s' is an alias for 'bzr %s'.\n" % (topic,
58
 
            " ".join(alias)))
 
43
    topics = indices.search(topic)
 
44
    shadowed_terms = []
 
45
    for index, topic in topics[1:]:
 
46
        shadowed_terms.append('%s%s' % (index.prefix, topic.get_help_topic()))
 
47
    outfile.write(topics[0][1].get_help_text(shadowed_terms))
59
48
 
60
49
 
61
50
def help_commands(outfile=None):