Mercurial > hg > graal-jvmci-8
changeset 5824:b1dc8fbebb48
mx now handles unambiguous command prefixes (e.g. instead of 'mx eclipseinit' you can use 'mx ec')
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 13 Jul 2012 09:06:14 +0200 |
parents | f238fe91dc7f |
children | 4c92e2b43789 |
files | mxtool/mx.py |
diffstat | 1 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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):