From: Tom Wilkie <tw275@cam.ac.uk>
To: xen-devel@lists.xensource.com
Subject: xm support for abbreviated commands
Date: Wed, 10 Aug 2005 14:02:35 +0100 [thread overview]
Message-ID: <42F9FAEB.5090603@cam.ac.uk> (raw)
[-- Attachment #1: Type: text/plain, Size: 224 bytes --]
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
[-- Attachment #2: xm-abv.diff --]
[-- Type: text/x-patch, Size: 581 bytes --]
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()
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
reply other threads:[~2005-08-10 13:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=42F9FAEB.5090603@cam.ac.uk \
--to=tw275@cam.ac.uk \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.