12 messages in com.xensource.lists.xen-develRe: [Xen-devel] xm create option pars...
FromSent OnAttachments
Steven Hand28 Jul 2004 09:37 
Tom Wilkie28 Jul 2004 09:44 
Ian Pratt28 Jul 2004 10:10 
Tom Wilkie28 Jul 2004 10:15 
Mike Wray30 Jul 2004 01:18 
Steven Hand30 Jul 2004 01:42 
Ian Pratt30 Jul 2004 01:49 
Mike Wray30 Jul 2004 02:07 
Mike Wray30 Jul 2004 02:15 
Ian Pratt30 Jul 2004 02:52 
Ian Pratt30 Jul 2004 02:58 
Mike Wray30 Jul 2004 06:41 
Subject:Re: [Xen-devel] xm create option parsing..
From:Steven Hand (Stev@cl.cam.ac.uk)
Date:07/30/2004 01:42:35 AM
List:com.xensource.lists.xen-devel

Steven Hand wrote:

As far as I can see, "xm create -c vmid=1" will create a domain and attach to its console while "xm create vmid=1 -c" won't.

Any reason for this? The option parsing routines xm/opts.py and xm/create.py seems substantial enough.

It's an artifact of getopt - it stops parsing options at the first non-option. So

xm create -c vmid=1

sets the -c option, whereas

xm create vmid=1 -c

doesn't.

It think there's a getopt flag to process options anywhere in the args, but this is a problem for a multicommand like xm that has its own options as well as subcommand options.

Basically options (-x, --x) have to precede args.

Ok - we should probably note this somewhere, particularly as I guess that many folks will be familiar with the gnu getopt style which doesn't assume that there are no more options once a non-option argument is seen.

cheers,

S.