# HG changeset patch # User Johannes Stezenbach # Date 2008-06-07 07:49:34 # Node ID ffcf8e82f6475b810d8518766160cd8a431352bd # Parent 2c9565971abcf49d711f467f9f5bb6e9740e122f help: enable listing of a subset of the command list Instead of giving the "command %s is ambiguous" error message with a bare list of possible command, display help list for all commands starting with the given string. diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -1253,7 +1253,14 @@ def help_(ui, name=None, with_version=Fa if with_version: version_(ui) ui.write('\n') - aliases, i = cmdutil.findcmd(ui, name, table) + + try: + aliases, i = cmdutil.findcmd(ui, name, table) + except cmdutil.AmbiguousCommand, inst: + select = lambda c: c.lstrip('^').startswith(inst.args[0]) + helplist(_('list of commands:\n\n'), select) + return + # synopsis ui.write("%s\n" % i[2])