changeset 1536:b4ed825282fe

Catch the exception raised with 'hg help <somethingambiguous>'. Example: 'hg help a'
author Thomas Arendsen Hein <thomas@intevation.de>
date Thu, 10 Nov 2005 16:16:28 +0100
parents c85e5bbfd141
children 583b3696d24d
files mercurial/commands.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Wed Nov 09 13:42:16 2005 -0800
+++ b/mercurial/commands.py	Thu Nov 10 16:16:28 2005 +0100
@@ -2640,6 +2640,9 @@
         u.debug(inst, "\n")
         u.warn(_("%s: invalid arguments\n") % cmd)
         help_(u, cmd)
+    except AmbiguousCommand, inst:
+        u.warn(_("hg: command '%s' is ambiguous.\n") % inst.args[0])
+        help_(u, 'shortlist')
     except UnknownCommand, inst:
         u.warn(_("hg: unknown command '%s'\n") % inst.args[0])
         help_(u, 'shortlist')