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: Lorenzo Bettini
Subject: Re: [help-gengetopt] mutually exclusive group of options
Date: Wed, 13 Jun 2007 16:12:56 +0200
User-agent: Thunderbird 1.5.0.12 (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/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




reply via email to

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