Mercurial > hg-stable
changeset 846:a30f7ee30914
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.
author | kreijack@inwind.REMOVEME.it |
---|---|
date | Sat, 06 Aug 2005 13:27:31 +0100 |
parents | 52576cf969f2 |
children | f1555f48f884 |
files | mercurial/commands.py |
diffstat | 1 files changed, 6 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py Sat Aug 06 13:27:31 2005 +0100 +++ b/mercurial/commands.py Sat Aug 06 13:27:31 2005 +0100 @@ -286,7 +286,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]) @@ -329,14 +329,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 @@ -1360,7 +1361,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:]