[PATCH 2 of 5] help: list special help topics with -v

Johannes Stezenbach js at sig21.net
Fri Jun 6 16:53:52 CDT 2008


2 files changed, 15 insertions(+)
mercurial/commands.py    |   10 ++++++++++
tests/test-extension.out |    5 +++++


# HG changeset patch
# User Johannes Stezenbach <js at sig21.net>
# Date 1212519414 -7200
# Node ID 02abce174989c944abd4f1ca2e93dfeb4d26b7a8
# Parent  dde725f3a79c3175f822ce61136730f90a7d3c27
help: list special help topics with -v

diff -r dde725f3a79c -r 02abce174989 mercurial/commands.py
--- a/mercurial/commands.py	Tue Jun 03 20:53:24 2008 +0200
+++ b/mercurial/commands.py	Tue Jun 03 20:56:54 2008 +0200
@@ -1399,6 +1399,16 @@
                                          default
                                          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])
diff -r dde725f3a79c -r 02abce174989 tests/test-extension.out
--- a/tests/test-extension.out	Tue Jun 03 20:53:24 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




More information about the Mercurial-devel mailing list