xm support for abbreviated commands
This patch adds support for abbreviated commands to xm.
Eg xm li -> xm list, for all those people where typing 'st' will kill them
It makes sure the abbreviated command is not ambiguous, and at least 2 letters long.
Tom
tools/python/xen/xm/main.py +4 -0
@@ -605,6 +605,10 @@ deprecated(cmd,aliases[cmd]) return commands[aliases[cmd]] else: + if len( cmd ) > 1: + matched_commands = filter( lambda (command, func): command[ 0:len(cmd) ] == cmd, commands.iteritems() ) + if len( matched_commands ) == 1: + return matched_commands[0][1] err('Sub Command %s not found!' % cmd) usage()
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel