mercurial/dispatch.py
changeset 24222 02d7b5cd373b
parent 24221 4e240d6ab898
child 24290 b76d8c641746
--- a/mercurial/dispatch.py	Mon Jan 26 15:43:13 2015 -0500
+++ b/mercurial/dispatch.py	Tue Feb 10 15:59:12 2015 -0500
@@ -220,7 +220,15 @@
             # (but don't check for extensions themselves)
             commands.help_(ui, inst.args[0], unknowncmd=True)
         except error.UnknownCommand:
-            commands.help_(ui, 'shortlist')
+            suggested = False
+            if len(inst.args) == 2:
+                sim = _getsimilar(inst.args[1], inst.args[0])
+                if sim:
+                    ui.warn(_('(did you mean one of %s?)\n') %
+                            ', '.join(sorted(sim)))
+                    suggested = True
+            if not suggested:
+                commands.help_(ui, 'shortlist')
     except error.InterventionRequired, inst:
         ui.warn("%s\n" % inst)
         return 1