Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 14285:aa64a87b493d
help: give hint about 'hg help -e' when appropriate
The hint is only given if a command shadows an extension with the same
name and when that extension has a multi-line module docstring.
author | Martin Geisler <mg@aragost.com> |
---|---|
date | Tue, 10 May 2011 13:19:05 +0200 |
parents | 1f9e11f65cd7 |
children | 005a540e9aee |
comparison
equal
deleted
inserted
replaced
14284:1f9e11f65cd7 | 14285:aa64a87b493d |
---|---|
2220 # options | 2220 # options |
2221 if entry[1]: | 2221 if entry[1]: |
2222 option_lists.append((_("options:\n"), entry[1])) | 2222 option_lists.append((_("options:\n"), entry[1])) |
2223 | 2223 |
2224 addglobalopts(False) | 2224 addglobalopts(False) |
2225 | |
2226 # check if this command shadows a non-trivial (multi-line) | |
2227 # extension help text | |
2228 try: | |
2229 mod = extensions.find(name) | |
2230 doc = gettext(mod.__doc__) or '' | |
2231 if '\n' in doc.strip(): | |
2232 msg = _('use "hg help -e %s" to show help for ' | |
2233 'the %s extension') % (name, name) | |
2234 ui.write('\n%s\n' % msg) | |
2235 except KeyError: | |
2236 pass | |
2225 | 2237 |
2226 def helplist(header, select=None): | 2238 def helplist(header, select=None): |
2227 h = {} | 2239 h = {} |
2228 cmds = {} | 2240 cmds = {} |
2229 for c, e in table.iteritems(): | 2241 for c, e in table.iteritems(): |