ia64/xen-unstable

changeset 6107:0761551e993a

Added support for abbreviated xm sub commands
author twilkie@paploo.uk.xensource.com
date Thu Aug 11 12:06:32 2005 +0000 (2005-08-11)
parents a64ac7fafbf0
children 10b395bc465e
files tools/python/xen/xm/main.py
line diff
     1.1 --- a/tools/python/xen/xm/main.py	Thu Aug 11 10:34:32 2005 +0000
     1.2 +++ b/tools/python/xen/xm/main.py	Thu Aug 11 12:06:32 2005 +0000
     1.3 @@ -605,6 +605,10 @@ def xm_lookup_cmd(cmd):
     1.4          deprecated(cmd,aliases[cmd])
     1.5          return commands[aliases[cmd]]
     1.6      else:
     1.7 +        if len( cmd ) > 1:
     1.8 +            matched_commands = filter( lambda (command, func): command[ 0:len(cmd) ] == cmd, commands.iteritems() )
     1.9 +            if len( matched_commands ) == 1:
    1.10 +		        return matched_commands[0][1]
    1.11          err('Sub Command %s not found!' % cmd)
    1.12          usage()
    1.13