|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] 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
diff -r 50e57636bdd8 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py Wed Aug 10 12:21:39 2005
+++ b/tools/python/xen/xm/main.py Wed Aug 10 13:59:44 2005
@@ -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
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread> |
- [Xen-devel] xm support for abbreviated commands,
Tom Wilkie <=
|
|
|
|
|