comparison mercurial/commands.py @ 14284:1f9e11f65cd7

help: add -e/--extension switch to display extension help text
author Henri Wiechers <hwiechers@gmail.com>
date Wed, 20 Jan 2010 20:24:20 +0200
parents 035489c9ea53
children aa64a87b493d
comparison
equal deleted inserted replaced
14283:035489c9ea53 14284:1f9e11f65cd7
2131 displayer = cmdutil.show_changeset(ui, repo, opts) 2131 displayer = cmdutil.show_changeset(ui, repo, opts)
2132 for ctx in heads: 2132 for ctx in heads:
2133 displayer.show(ctx) 2133 displayer.show(ctx)
2134 displayer.close() 2134 displayer.close()
2135 2135
2136 def help_(ui, name=None, with_version=False, unknowncmd=False, full=True): 2136 def help_(ui, name=None, with_version=False, unknowncmd=False, full=True, **opts):
2137 """show help for a given topic or a help overview 2137 """show help for a given topic or a help overview
2138 2138
2139 With no arguments, print a list of commands with short help messages. 2139 With no arguments, print a list of commands with short help messages.
2140 2140
2141 Given a topic, extension, or command name, print help for that 2141 Given a topic, extension, or command name, print help for that
2330 2330
2331 if name and name != 'shortlist': 2331 if name and name != 'shortlist':
2332 i = None 2332 i = None
2333 if unknowncmd: 2333 if unknowncmd:
2334 queries = (helpextcmd,) 2334 queries = (helpextcmd,)
2335 elif opts.get('extension'):
2336 queries = (helpext,)
2335 else: 2337 else:
2336 queries = (helptopic, helpcmd, helpext, helpextcmd) 2338 queries = (helptopic, helpcmd, helpext, helpextcmd)
2337 for f in queries: 2339 for f in queries:
2338 try: 2340 try:
2339 f(name) 2341 f(name)
4703 _('show active branchheads only (DEPRECATED)')), 4705 _('show active branchheads only (DEPRECATED)')),
4704 ('c', 'closed', False, 4706 ('c', 'closed', False,
4705 _('show normal and closed branch heads')), 4707 _('show normal and closed branch heads')),
4706 ] + templateopts, 4708 ] + templateopts,
4707 _('[-ac] [-r STARTREV] [REV]...')), 4709 _('[-ac] [-r STARTREV] [REV]...')),
4708 "help": (help_, [], _('[TOPIC]')), 4710 "help": (help_,
4711 [('e', 'extension', None, _('show only help for extensions'))],
4712 _('[-e] [TOPIC]')),
4709 "identify|id": 4713 "identify|id":
4710 (identify, 4714 (identify,
4711 [('r', 'rev', '', 4715 [('r', 'rev', '',
4712 _('identify the specified revision'), _('REV')), 4716 _('identify the specified revision'), _('REV')),
4713 ('n', 'num', None, _('show local revision number')), 4717 ('n', 'num', None, _('show local revision number')),