help-gengetopt
[Top][All Lists]
Advanced

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

Re: [help-gengetopt] mutually exclusive group of options


From: Papp Gyozo (VBuster)
Subject: Re: [help-gengetopt] mutually exclusive group of options
Date: Thu, 14 Jun 2007 13:01:15 +0200

> > 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->@address@hidden
    && !(args_info->@address@hidden
@if@ dep_option_is_flag  @then@
        || args_info->@address@hidden
@elseif dep_option_has arg @then@
        || args_info->@address@hidden
@endif@
        ))

    ))
  {
    fprintf (stderr, "%s: @option_descr@ option depends on option 
'@dep_option_descr@'%s\n", @package_var_name@, (additional_error ? 
additional_error : ""));
    error = 1;
  }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]