Mercurial > hg-stable
changeset 9295:b0f447a259ab
help: use field lists for lists of extensions
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Mon, 03 Aug 2009 00:01:50 +0200 |
parents | 5f4862a00697 |
children | 5043a5b16d91 |
files | mercurial/help.py tests/test-extension.out tests/test-keyword.out tests/test-mq.out |
diffstat | 4 files changed, 8 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/help.py Sun Aug 02 23:38:08 2009 +0200 +++ b/mercurial/help.py Mon Aug 03 00:01:50 2009 +0200 @@ -43,11 +43,9 @@ '''return a text listing of the given extensions''' if not exts: return '' - # TODO: literal block is wrong, should be a field list or a simple table. - result = '\n%s\n\n ::\n\n' % header + result = '\n%s\n\n' % header for name, desc in sorted(exts.iteritems()): - desc = util.wrap(desc, maxlength + 5) - result += ' %s %s\n' % (name.ljust(maxlength), desc) + result += ' %-*s %s\n' % (maxlength + 2, ':%s:' % name, desc) return result def extshelp():
--- a/tests/test-extension.out Sun Aug 02 23:38:08 2009 +0200 +++ b/tests/test-extension.out Mon Aug 03 00:01:50 2009 +0200 @@ -33,7 +33,7 @@ enabled extensions: - debugextension only debugcommands + debugextension only debugcommands global options: -R --repository repository root directory or symbolic path name @@ -63,7 +63,7 @@ enabled extensions: - debugextension only debugcommands + debugextension only debugcommands global options: -R --repository repository root directory or symbolic path name
--- a/tests/test-keyword.out Sun Aug 02 23:38:08 2009 +0200 +++ b/tests/test-keyword.out Mon Aug 03 00:01:50 2009 +0200 @@ -54,9 +54,9 @@ enabled extensions: - keyword expand keywords in tracked files - mq manage a stack of patches - notify hooks for sending email notifications at commit/push time + keyword expand keywords in tracked files + mq manage a stack of patches + notify hooks for sending email notifications at commit/push time use "hg -v help keyword" to show aliases and global options % hg kwdemo