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

Re: [Xen-devel] [PATCH 3 of 3 V2] xl: SWITCH_FOREACH_OPT handles special options directly



Ian Campbell writes ("[PATCH 3 of 3 V2] xl: SWITCH_FOREACH_OPT handles special 
options directly"):
> xl: SWITCH_FOREACH_OPT handles special options directly.
> 
> This removes the need for the "case 0: case 2:" boilerplate in every
> main_foo() but at the expense of a return in a macro which I find
> (mildly) distasteful.

I agree that it's best avoided.  I think it would be better simply
to have the actual function call exit().

Having the option parser terminate the program when necessary is far
simpler and causes no problems.  (If we didn't have an atexit handler,
we could provide a wrapper for exit for xl's internal callers.)

The reason why generic option handling libraries don't typically call
exit is that they don't know what the application they're in might
want by way of exit statuses, stdout/err handling, pre-exit cleanup,
or whatever.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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