--- a/mercurial/help.py Sun Jun 21 23:17:05 2009 +0200
+++ b/mercurial/help.py Mon Jun 22 00:02:31 2009 +0200
@@ -5,6 +5,7 @@
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2, incorporated herein by reference.
+import textwrap
from i18n import _
import extensions
@@ -45,7 +46,11 @@
return ''
result = '\n%s\n\n' % header
for name, desc in sorted(exts.iteritems()):
- result += ' %s %s\n' % (name.ljust(maxlength), desc)
+ # wrap desc at 70 characters, just like the main help texts
+ desc = textwrap.wrap(desc, width=70 - maxlength - 4)
+ pad = '\n' + ' ' * (maxlength + 4)
+ result += ' %s %s\n' % (name.ljust(maxlength),
+ pad.join(desc))
return result
def extshelp():