comparison mercurial/commands.py @ 14316:d5b525697ddb

extensions: drop maxlength from enabled and disabled This is a bad/silly API. Instead calculate maxlength in one place in help it's used and simplify all the callers.
author Matt Mackall <mpm@selenic.com>
date Fri, 13 May 2011 11:04:51 -0500
parents 32a548776b65
children 1f46be4689ed
comparison
equal deleted inserted replaced
14315:f6b3b346d80c 14316:d5b525697ddb
2750 def helpextcmd(name): 2750 def helpextcmd(name):
2751 cmd, ext, mod = extensions.disabledcmd(ui, name, ui.config('ui', 'strict')) 2751 cmd, ext, mod = extensions.disabledcmd(ui, name, ui.config('ui', 'strict'))
2752 doc = gettext(mod.__doc__).splitlines()[0] 2752 doc = gettext(mod.__doc__).splitlines()[0]
2753 2753
2754 msg = help.listexts(_("'%s' is provided by the following " 2754 msg = help.listexts(_("'%s' is provided by the following "
2755 "extension:") % cmd, {ext: doc}, len(ext), 2755 "extension:") % cmd, {ext: doc}, indent=4)
2756 indent=4)
2757 ui.write(minirst.format(msg, textwidth)) 2756 ui.write(minirst.format(msg, textwidth))
2758 ui.write('\n\n') 2757 ui.write('\n\n')
2759 ui.write(_('use "hg help extensions" for information on enabling ' 2758 ui.write(_('use "hg help extensions" for information on enabling '
2760 'extensions\n')) 2759 'extensions\n'))
2761 2760
2797 else: 2796 else:
2798 header = _('list of commands:\n\n') 2797 header = _('list of commands:\n\n')
2799 2798
2800 helplist(header) 2799 helplist(header)
2801 if name != 'shortlist': 2800 if name != 'shortlist':
2802 exts, maxlength = extensions.enabled() 2801 text = help.listexts(_('enabled extensions:'), extensions.enabled())
2803 text = help.listexts(_('enabled extensions:'), exts, maxlength)
2804 if text: 2802 if text:
2805 ui.write("\n%s\n" % minirst.format(text, textwidth)) 2803 ui.write("\n%s\n" % minirst.format(text, textwidth))
2806 2804
2807 # list all option lists 2805 # list all option lists
2808 opt_output = [] 2806 opt_output = []