~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/help.py

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
        outfile = sys.stdout
41
41
 
42
42
    indices = HelpIndices()
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))
 
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)))
48
59
 
49
60
 
50
61
def help_commands(outfile=None):