[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Re: [PATCH] xl: refactor common parts of command line parsing



On Fri, 2011-04-15 at 08:33 +0100, Andre Przywara wrote:
> Hi,
> 
> xl command options are currently handled in each command's sub function, 
> leading to a lot of duplicate code.
> This patch moves the common part of it into a separate function,
> which handles the help switch, unknown options and an insufficient
> number of parameters. This removes a lot of redundant code.
> 
> Due to the high number of commands this patch is rather large. If that 
> would help reviewers, I could split it up, though this would be rather 
> artificial. Just tell me.
> 
> 
> Signed-off-by: Andre Przywara <andre.przywara@xxxxxxx>

Thanks, I bet the diffstat looks awesome!

One thing I noticed is that the def_getopt function doesn't add 'h' to
the optstring, which confused me at first but I see now that you handle
that by handling it in the case where getopt returns '?', clever.

Looks like you also found a few unused options along they way ("n:"
seems to have been cut-and-pasted into a bunch of incorrect places).

Due to the length I've not reviewed in great detail but I think we
should just take this and fix up any fallout as it is discovered.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.