changeset 6653:a78d8edaeedd

help: list special help topics with -v
author Johannes Stezenbach <js@sig21.net>
date Tue, 03 Jun 2008 20:56:54 +0200
parents ffcf8e82f647
children 2713e42dcf4e
files mercurial/commands.py tests/test-extension.out
diffstat 2 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Sat Jun 07 09:49:34 2008 +0200
+++ b/mercurial/commands.py	Tue Jun 03 20:56:54 2008 +0200
@@ -1401,6 +1401,16 @@
                                          and _(" (default: %s)") % default
                                          or "")))
 
+    if ui.verbose:
+        ui.write(_("\nspecial help topics:\n"))
+        topics = []
+        for i in help.helptable:
+            l = i.split('|')
+            topics.append((", ".join(l[:-1]), l[-1]))
+        topics_len = max([len(s[0]) for s in topics])
+        for t, desc in topics:
+            ui.write(" %-*s  %s\n" % (topics_len, t, desc))
+
     if opt_output:
         opts_len = max([len(line[0]) for line in opt_output if line[1]] or [0])
         for first, second in opt_output:
--- a/tests/test-extension.out	Sat Jun 07 09:49:34 2008 +0200
+++ b/tests/test-extension.out	Tue Jun 03 20:56:54 2008 +0200
@@ -33,6 +33,11 @@
  debugfoobar:
       yet another debug command
 
+special help topics:
+ dates             Date Formats
+ patterns          File Name Patterns
+ environment, env  Environment Variables
+
 global options:
  -R --repository      repository root directory or symbolic path name
     --cwd             change working directory