Re: mutually exclusive group of options

Lorenzo Bettini <[email protected]>
Newsgroups gmane.comp.gnu.gengetopt.general
Message-ID <[email protected]>
Papp Gyozo (VBuster) wrote:
>> option  "dependant"         D
>>    "option that depends on str-opt" int optional dependon="str-opt"
>>
>> does this solve your problem?
> 
> More or less. I actually idealize the situation to strip down my problem:
> 
>>> scan --init   --dir1=... --dir2=...
>>> scan --attach --address=...
> 
> The first usage is default (used much more than the second one), moreover the distinctive option (ie. --init) is not required even more a hidden option actually *without* default values. So in most cases the user doesn't specify the "main" option either because he has not to do so or because he simply are not aware of it.  Thus in my understanding if --init is not present, error will be generated each time if a dependant option is given.
> 
>     scan --init=/path/to/lib/to/load.so --dir1=... --dir2=... ; no error
> 
>     scan --dir1=... --dir2=... ; error because no --init is given
> 
> Unfortunately this latter one is the most common use-case with this application. :-(
> I'm thinking about what default value I can define for --init to be compatible with previous versions.

Hi there

from your original mail I seemd to understand that --dir options can 
appear only if --init is given, isn't it so?  If not, then you can 
simply make them independent from --init, can't you?

Or am I missing something?

cheers
	Lorenzo

-- 
Lorenzo Bettini, PhD in Computer Science, DSI, Univ. di Firenze
ICQ# lbetto, 16080134     (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
BLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
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.