# HG changeset patch # User Matt Mackall # Date 2011-09-17 19:46:00 # Node ID d3ad0e9d4be28dc446c10669324d16eb4a624c58 # Parent bdc5950591085323389d1835dfdc6bf9d4facb43 help: fold some list help clauses into the helplist function diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2848,6 +2848,19 @@ def help_(ui, name=None, unknowncmd=Fals 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 @@ def help_(ui, name=None, unknowncmd=Fals 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))