# HG changeset patch # User Doug Simon # Date 1342163174 -7200 # Node ID b1dc8fbebb48269523bd5786fd1a5c75fab75716 # Parent f238fe91dc7f35703d0451ad9a7c01d6b6af009d mx now handles unambiguous command prefixes (e.g. instead of 'mx eclipseinit' you can use 'mx ec') diff -r f238fe91dc7f -r b1dc8fbebb48 mxtool/mx.py --- a/mxtool/mx.py Thu Jul 12 17:16:34 2012 +0200 +++ b/mxtool/mx.py Fri Jul 13 09:06:14 2012 +0200 @@ -2420,7 +2420,13 @@ command_args = commandAndArgs[1:] if not commands.has_key(command): - abort('mx: unknown command \'{0}\'\n{1}use "mx help" for more options'.format(command, _format_commands())) + hits = [c for c in commands.iterkeys() if c.startswith(command)] + if len(hits) == 1: + command = hits[0] + elif len(hits) == 0: + abort('mx: unknown command \'{0}\'\n{1}use "mx help" for more options'.format(command, _format_commands())) + else: + abort('mx: command \'{0}\' is ambiguous\n {1}'.format(command, ' '.join(hits))) c, _ = commands[command][:2] def term_handler(signum, frame):