diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -7,7 +7,7 @@ from node import hex, nullid, nullrev, short from i18n import _, gettext -import os, re, sys +import os, re, sys, textwrap import hg, util, revlog, bundlerepo, extensions, copies, context, error import difflib, patch, time, help, mdiff, tempfile, url, encoding import archival, changegroup, cmdutil, hgweb.server, sshserver, hbisect @@ -1532,7 +1532,11 @@ def help_(ui, name=None, with_version=Fa opts_len = max([len(line[0]) for line in opt_output if line[1]] or [0]) for first, second in opt_output: if second: - ui.write(" %-*s %s\n" % (opts_len, first, second)) + # wrap descriptions at 70 characters, just like the + # main help texts + second = textwrap.wrap(second, width=70 - opts_len - 3) + pad = '\n' + ' ' * (opts_len + 3) + ui.write(" %-*s %s\n" % (opts_len, first, pad.join(second))) else: ui.write("%s\n" % first) diff --git a/tests/test-extension.out b/tests/test-extension.out --- a/tests/test-extension.out +++ b/tests/test-extension.out @@ -40,7 +40,8 @@ enabled extensions: global options: -R --repository repository root directory or symbolic path name --cwd change working directory - -y --noninteractive do not prompt, assume 'yes' for any required answers + -y --noninteractive do not prompt, assume 'yes' for any required + answers -q --quiet suppress output -v --verbose enable additional output --config set/override config option diff --git a/tests/test-record.out b/tests/test-record.out --- a/tests/test-record.out +++ b/tests/test-record.out @@ -27,8 +27,10 @@ interactively select changes to commit options: - -A --addremove mark new/missing files as added/removed before committing - --close-branch mark a branch as closed, hiding it from the branch list + -A --addremove mark new/missing files as added/removed before + committing + --close-branch mark a branch as closed, hiding it from the branch + list -I --include include names matching the given patterns -X --exclude exclude names matching the given patterns -m --message use as commit message