~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/help.py

  • Committer: Jelmer Vernooij
  • Date: 2011-09-26 15:21:01 UTC
  • mfrom: (6165.2.3 avoid-revision-history)
  • mto: This revision was merged to the branch mainline in revision 6216.
  • Revision ID: jelmer@samba.org-20110926152101-afcxw1hikybyivfd
merge avoid-revision-history.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2004, 2005, 2006 Canonical Ltd
 
1
# Copyright (C) 2005-2011 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
22
22
# TODO: `help commands --all` should show hidden commands
23
23
 
24
24
import sys
25
 
import textwrap
26
25
 
27
26
from bzrlib import (
28
27
    commands as _mod_commands,
30
29
    help_topics,
31
30
    osutils,
32
31
    plugin,
33
 
    symbol_versioning,
 
32
    utextwrap,
34
33
    )
35
34
 
36
35
 
45
44
    try:
46
45
        topics = indices.search(topic)
47
46
        shadowed_terms = []
48
 
        for index, topic in topics[1:]:
 
47
        for index, topic_obj in topics[1:]:
49
48
            shadowed_terms.append('%s%s' % (index.prefix,
50
 
                topic.get_help_topic()))
 
49
                topic_obj.get_help_topic()))
51
50
        source = topics[0][1]
52
51
        outfile.write(source.get_help_text(shadowed_terms))
53
52
    except errors.NoHelpTopic:
97
96
        else:
98
97
            firstline = ''
99
98
        helpstring = '%-*s %s%s' % (max_name, cmd_name, firstline, plugin_name)
100
 
        lines = textwrap.wrap(
 
99
        lines = utextwrap.wrap(
101
100
            helpstring, subsequent_indent=indent,
102
101
            width=width,
103
102
            break_long_words=False)
136
135
            help_topics.HelpTopicIndex(),
137
136
            _mod_commands.HelpCommandIndex(),
138
137
            plugin.PluginsHelpIndex(),
 
138
            help_topics.ConfigOptionHelpIndex(),
139
139
            ]
140
140
 
141
141
    def _check_prefix_uniqueness(self):