Mercurial > public > mercurial-scm > hg
diff mercurial/commands.py @ 7125:4a1ac535be1d
show enabled extensions in hg help
author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
---|---|
date | Sat, 18 Oct 2008 16:50:03 +0200 |
parents | a4769dec7773 |
children | 111813de4188 |
line wrap: on
line diff
--- a/mercurial/commands.py Sat Oct 18 16:09:07 2008 +0200 +++ b/mercurial/commands.py Sat Oct 18 16:50:03 2008 +0200 @@ -1335,6 +1335,19 @@ else: ui.write(' %-*s %s\n' % (m, f, h[f])) + exts = list(extensions.extensions()) + if exts: + ui.write(_('\nenabled extensions:\n\n')) + maxlength = 0 + exthelps = [] + for ename, ext in exts: + doc = (ext.__doc__ or _('(no help text available)')) + ename = ename.split('.')[-1] + maxlength = max(len(ename), maxlength) + exthelps.append((ename, doc.splitlines(0)[0].strip())) + for ename, text in exthelps: + ui.write(_(' %s %s\n') % (ename.ljust(maxlength), text)) + if not ui.quiet: addglobalopts(True)