Mercurial > hg
changeset 15126:d3ad0e9d4be2
help: fold some list help clauses into the helplist function
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sat, 17 Sep 2011 14:46:00 -0500 |
parents | bdc595059108 |
children | 2c80862728cb |
files | mercurial/commands.py |
diffstat | 1 files changed, 13 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py Sat Sep 17 14:17:09 2011 -0500 +++ b/mercurial/commands.py Sat Sep 17 14:46:00 2011 -0500 @@ -2848,6 +2848,19 @@ if not ui.quiet: addglobalopts(True) + if not name: + text = help.listexts(_('enabled extensions:'), extensions.enabled()) + if text: + ui.write("\n%s" % minirst.format(text, textwidth)) + + ui.write(_("\nadditional help topics:\n\n")) + topics = [] + for names, header, doc in help.helptable: + topics.append((sorted(names, key=len, reverse=True)[0], header)) + topics_len = max([len(s[0]) for s in topics]) + for t, desc in topics: + ui.write(" %-*s %s\n" % (topics_len, t, desc)) + def helptopic(name): for names, header, doc in help.helptable: if name in names: @@ -2943,19 +2956,6 @@ header = _('list of commands:\n\n') helplist(header) - if name != 'shortlist': - text = help.listexts(_('enabled extensions:'), extensions.enabled()) - if text: - ui.write("\n%s" % minirst.format(text, textwidth)) - - if not name: - ui.write(_("\nadditional help topics:\n\n")) - topics = [] - for names, header, doc in help.helptable: - topics.append((sorted(names, key=len, reverse=True)[0], header)) - topics_len = max([len(s[0]) for s in topics]) - for t, desc in topics: - ui.write(" %-*s %s\n" % (topics_len, t, desc)) ui.write(opttext(optlist, textwidth))