[TAKE 2][PATCH 2/5]: Show commands aliases and global options in help

Goffredo Baroncelli kreijack at aliceposta.it
Mon Jul 25 18:57:29 UTC 2005


# HG changeset patch
# User kreijack at inwind.REMOVEME.it
# Node ID 7874c8368615d1063c811a80b221a2eda98f8a76
# Parent  53ed816554443fdbeebe3643e10e623ce14050c9
'hg help -v' mentions the alias of the commands

diff -r 53ed81655444 -r 7874c8368615 mercurial/commands.py
--- a/mercurial/commands.py     Sun Jul 24 10:03:04 2005
+++ b/mercurial/commands.py     Sun Jul 24 10:05:50 2005
@@ -311,6 +311,7 @@
             ui.write('basic hg commands (use "hg help -v" for more):\n\n')

         h = {}
+        cmds = {}
         for c, e in table.items():
             f = c.split("|")[0]
             if not ui.verbose and not f.startswith("^"):
@@ -322,12 +323,17 @@
             if e[0].__doc__:
                 d = e[0].__doc__.splitlines(0)[0].rstrip()
             h[f] = d
+            cmds[f]=c.lstrip("^")

         fns = h.keys()
         fns.sort()
         m = max(map(len, fns))
         for f in fns:
-            ui.write(' %-*s   %s\n' % (m, f, h[f]))
+            if ui.verbose:
+                commands = cmds[f].replace("|",", ")
+                ui.write(" %s:\n      %s\n"%(commands,h[f]))
+            else:
+                ui.write(' %-*s   %s\n' % (m, f, h[f]))

 # Commands start here, listed alphabetically


-- 
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kreijack AT inwind.it>
Key fingerprint = CE3C 7E01 6782 30A3 5B87  87C0 BB86 505C 6B2A CFF9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20050725/ffbb8841/attachment-0001.asc>


More information about the Mercurial mailing list