[TAKE 2][PATCH 4/5]: Show commands aliases and global options in
help
Goffredo Baroncelli
kreijack at aliceposta.it
Mon Jul 25 13:57:39 CDT 2005
# HG changeset patch
# User kreijack at inwind.REMOVEME.it
# Node ID 32a996d8fcbf8b8c714fdf1bbeb6a15a282f39ef
# Parent 7f6e227ef14c452244e6dfce0d1254bb4ac80f97
When hg is invoked without parameters, the short list help is displayed.
When hg is executed without parameters ( or hg is executed with the
'help shortlist' command ) the short help list is displayed.
If the 'help' command is passed on the commandline the full help list
is displayed.
In both the cases if the switch '-v' is passed, the help contains also
the aliases of the short/full commands list and the global switches.
diff -r 7f6e227ef14c -r 32a996d8fcbf mercurial/commands.py
--- a/mercurial/commands.py Sun Jul 24 10:06:49 2005
+++ b/mercurial/commands.py Mon Jul 25 18:52:08 2005
@@ -264,7 +264,7 @@
def help_(ui, cmd=None):
"""show help for a given command or all commands"""
- if cmd:
+ if cmd and cmd != 'shortlist':
try:
i = find(cmd)
ui.write("%s\n\n" % i[2])
@@ -307,14 +307,15 @@
ui.write("\n")
ui.write('hg commands:\n\n')
- else:
- ui.write('basic hg commands (use "hg help -v" for more):\n\n')
+
+ if cmd == "shortlist":
+ ui.write('basic hg commands (use "hg help" for more):\n\n')
h = {}
cmds = {}
for c, e in table.items():
f = c.split("|")[0]
- if not ui.verbose and not f.startswith("^"):
+ if cmd == "shortlist" and not f.startswith("^"):
continue
if not ui.debugflag and f.startswith("debug"):
continue
@@ -1278,7 +1279,7 @@
if options["version"]:
return ("version", show_version, [], options, cmdoptions)
elif not args:
- return ("help", help_, [], options, cmdoptions)
+ return ("help", help_, ["shortlist"], options, cmdoptions)
else:
cmd, args = args[0], args[1:]
--
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://www.selenic.com/pipermail/mercurial/attachments/20050725/7a33bf71/attachment-0001.pgp
More information about the Mercurial
mailing list