Re: mutually exclusive group of options

"Papp Gyozo (VBuster)" <[email protected]>
Newsgroups gmane.comp.gnu.gengetopt.general
Message-ID <[email protected]>
> > 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:
> But I don't know how. (It was a long time ago when I made changes to the
> gengetopt source...)

Well I'm getting enjoy it:) Here is the modified version of the skeleton. UNfortunately I haven't time to propagate all the necessary changes in the source tree, so if any help and contribution is very appreciated.

if (args_info->@option_var_name@_given
    && !(args_info->@dep_option@_given
@if@ dep_option_is_flag  @then@
        || args_info->@dep_option@_flag
@elseif dep_option_has arg @then@
        || args_info->@dep_option@_arg
@endif@
        ))

    ))
  {
    fprintf (stderr, "%s: @option_descr@ option depends on option '@dep_option_descr@'%s\n", @package_var_name@, (additional_error ? additional_error : ""));
    error = 1;
  }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.