diff 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
line wrap: on
line diff
--- a/mercurial/commands.py	Mon May 09 18:11:08 2011 +0200
+++ b/mercurial/commands.py	Wed Jan 20 20:24:20 2010 +0200
@@ -2133,7 +2133,7 @@
         displayer.show(ctx)
     displayer.close()
 
-def help_(ui, name=None, with_version=False, unknowncmd=False, full=True):
+def help_(ui, name=None, with_version=False, unknowncmd=False, full=True, **opts):
     """show help for a given topic or a help overview
 
     With no arguments, print a list of commands with short help messages.
@@ -2332,6 +2332,8 @@
         i = None
         if unknowncmd:
             queries = (helpextcmd,)
+        elif opts.get('extension'):
+            queries = (helpext,)
         else:
             queries = (helptopic, helpcmd, helpext, helpextcmd)
         for f in queries:
@@ -4705,7 +4707,9 @@
            _('show normal and closed branch heads')),
          ] + templateopts,
          _('[-ac] [-r STARTREV] [REV]...')),
-    "help": (help_, [], _('[TOPIC]')),
+    "help": (help_,
+        [('e', 'extension', None, _('show only help for extensions'))],
+        _('[-e] [TOPIC]')),
     "identify|id":
         (identify,
          [('r', 'rev', '',