[Top][All Lists]

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

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

From: Lorenzo Bettini
Subject: Re: [help-gengetopt] mutually exclusive group of options
Date: Wed, 13 Jun 2007 16:12:56 +0200
User-agent: Thunderbird (Windows/20070509)

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/ --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?


Lorenzo Bettini, PhD in Computer Science, DSI, Univ. di Firenze
ICQ# lbetto, 16080134     (GNU/Linux User # 158233)

reply via email to

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