From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Wray Subject: Re: xm create option parsing.. Date: Fri, 30 Jul 2004 14:41:57 +0100 Sender: xen-devel-admin@lists.sourceforge.net Message-ID: <410A5025.80303@hpl.hp.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Errors-To: xen-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Ian Pratt Cc: Steven Hand , xen-devel@lists.sourceforge.net List-Id: xen-devel@lists.xenproject.org Ian Pratt wrote: >>>Each subcommand is responsible for parsing its own options, so >>>we could get 'xm create' etc. to allow options after the args. >>>I'll make the change. >> >>Oops. The gnu-style getopt parsing is a Python 2.3 feature - not >>available in 2.2. So we can't enable it at the moment. > > > That's a bind. I'm going to have to cave in and switch to 2.3 at > some point, but I'd like to hold out for a while longer. > > 'create' is the only sub command that really suffers from this, > so could we just temporally hack the parsing to call getopt again > on the arguments[1:] and append to the list? Not pretty, but... > It's worse than that - because getopt bails on the first non-option we have to keep on calling it iteratively. Might as well write your own getopt :-). The way out is to go with 2.3 and use gnu_getopt or do some backport hack for the code for 2.3 to 2.2. In the meantime just document that the format is command [options] [args] Mike ------------------------------------------------------- This SF.Net email is sponsored by OSTG. Have you noticed the changes on Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now, one more big change to announce. We are now OSTG- Open Source Technology Group. Come see the changes on the new OSTG site. www.ostg.com