> What would happen if such a base option (btw how do you call it when
> other options depend on it?) may not be required if it had a default
> value? (Or enabled/switched on by default like "flag on")
I see in dependant_option.h_skel which condition is needed to modify/extend:
if (args_info->@[EMAIL PROTECTED] && ! args_info->@[EMAIL PROTECTED])
{
...
}
But I don't know how. (It was a long time ago when I made changes to the
gengetopt source...)
So here is my theory as a pseudo code:
if (args_info->@[EMAIL PROTECTED]
&& !(args_info->@[EMAIL PROTECTED]
#if @dep_option@ is flag
|| args_info->@[EMAIL PROTECTED]
#elif @dep_option@ has arg
|| !args_info->@[EMAIL PROTECTED]
#endif
))
{
...
}
AFAIR gengen supports some kind of #if .. #endif contructs.
> defgroup "mode"
> groupoption "init" default="..." group="mode"
> groupoption "attach" group="mode"
>
> option "dir1" dependon="init"
> option "dir2" dependon="init"
>
> option "attach-arg" dependon="attach"
>
> This way all below are valid:
>
> scan --dir1
> scan --dir2
> scan --dir1 --dir2
> scan --init --dir1 --dir2
> etc.
>
> but these generate errors in parsing phase:
>
> scan --init --attach-arg
> scan --attach --dir1
> scan --attach --dir2
>
_______________________________________________
Help-gengetopt mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gengetopt