~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/help.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-06-30 16:48:11 UTC
  • mfrom: (5967.9.6 regexps)
  • Revision ID: pqm@pqm.ubuntu.com-20110630164811-kpfgfqyzdzxnn8q6
(mbp) use explicit lazy regexps when appropriate (bug 608054) (Martin Pool)

Show diffs side-by-side

added added

removed removed

Lines of Context:
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,
 
32
    utextwrap,
33
33
    )
34
34
 
35
35
 
44
44
    try:
45
45
        topics = indices.search(topic)
46
46
        shadowed_terms = []
47
 
        for index, topic in topics[1:]:
 
47
        for index, topic_obj in topics[1:]:
48
48
            shadowed_terms.append('%s%s' % (index.prefix,
49
 
                topic.get_help_topic()))
 
49
                topic_obj.get_help_topic()))
50
50
        source = topics[0][1]
51
51
        outfile.write(source.get_help_text(shadowed_terms))
52
52
    except errors.NoHelpTopic:
96
96
        else:
97
97
            firstline = ''
98
98
        helpstring = '%-*s %s%s' % (max_name, cmd_name, firstline, plugin_name)
99
 
        lines = textwrap.wrap(
 
99
        lines = utextwrap.wrap(
100
100
            helpstring, subsequent_indent=indent,
101
101
            width=width,
102
102
            break_long_words=False)