~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/help_topics/__init__.py

  • Committer: Martin Pool
  • Date: 2009-03-19 03:58:36 UTC
  • mto: (4070.11.9 249908-doc-generate)
  • mto: This revision was merged to the branch mainline in revision 4464.
  • Revision ID: mbp@sourcefrog.net-20090319035836-c7jgh5weino3r5qn
Ask textwrap not to break long words or on hyphens

Show diffs side-by-side

added added

removed removed

Lines of Context:
207
207
    import textwrap
208
208
 
209
209
    def add_string(proto, help, maxl, prefix_width=20):
210
 
       help_lines = textwrap.wrap(help, maxl - prefix_width)
 
210
       help_lines = textwrap.wrap(help, maxl - prefix_width,
 
211
            break_long_words=False,
 
212
            break_on_hyphens=False)
211
213
       line_with_indent = '\n' + ' ' * prefix_width
212
214
       help_text = line_with_indent.join(help_lines)
213
215
       return "%-20s%s\n" % (proto, help_text)