~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/help.py

  • Committer: Vincent Ladeuil
  • Date: 2008-01-03 08:49:38 UTC
  • mfrom: (3111.1.31 175524)
  • mto: This revision was merged to the branch mainline in revision 3158.
  • Revision ID: v.ladeuil+lp@free.fr-20080103084938-7kvurk5uvde2ui54
Fix bug #175524, http test servers are 1.1 compliant

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):
96
107
 
97
108
help_topics.topic_registry.register("commands",
98
109
                                    _help_commands_to_text,
99
 
                                    "Basic help for all commands")
 
110
                                    "Basic help for all commands",
 
111
                                    help_topics.SECT_HIDDEN)
100
112
help_topics.topic_registry.register("hidden-commands",
101
113
                                    _help_commands_to_text,
102
 
                                    "All hidden commands")
 
114
                                    "All hidden commands",
 
115
                                    help_topics.SECT_HIDDEN)
103
116
 
104
117
 
105
118
class HelpIndices(object):