Huidae Cho wrote:

> I think we need two more functions:

>         // if the first option is present, all the other options must also be 
> present.
>         // same as multiple G_option_requires(first, opt)...
>         void G_option_requires_all(void *first, ...);

As you note, this can be achieved with multiple G_option_requires()
calls.

>         // if any option is present, all the other options must also be 
> present.
>         // all or nothing from a set
>         void G_option_inclusive(void *first, ...);

This could be achieved with multiple G_option_requires_all() calls. Or
even multiple G_option_requires() calls, but the number of such calls
would grow quadratically.

Apart from minimising the number of calls, there's probably some value
in terms of "documentation" to having specific rules for these cases.

Ultimately, there's no limit to the number of functions which *might*
be required. We should aim to capture all of the common cases first,
then figure out how to deal with anything which remains.

I'll make a start on this.

-- 
Glynn Clements <gl...@gclements.plus.com>
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to