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: Fri, 15 Jun 2007 13:37:22 +0200
User-agent: Mozilla-Thunderbird 2.0.0.0 (X11/20070601)

Papp Gyozo (VBuster) wrote:
Group options have already their individual _arg & _orig fields in
the structure, as far as I know. Let me rephrase what I mentioned
previously: be able to set a default group option! If not specified
anything at all from the group gengetopt may behave as if this option
were set. (--init in my example.)

yes probably this is quite a clean semantics:

- check that only one group option has a default
- set the default
- then use only the _given field to check conflicts

probably this should do


I admit this is not the best approach to this specific problem but: -
it suffices my needs - and I think it is a really viable feature
anyhow.

clean semantics of group options (flag options was a legacy of the
very first version of gengetopt - I'm not the first author of
gengentopt - and I think that flag options make a little sense
too)...

Well, I share your point of view about flags. I just noted that we
had to deal with them, too.

indeed, my main idea was to depecrate them and remove them in new releases


Even a "base"
option with a default value might make dependent options harder to
 understand: an option that depends on another option implicitly
requires the other option to be provided, otherwise it would make a
little sense.

You are right in theory. Actually my main concern is being compatible
with previous version where this --init option was simply optional.
Now this --init option seemed the best counterpart of the newly
introduced --attach option, that was the reason why I wanted them to
form a group. (From this point you could get know the whole story.)

A situation like the one you describes implicitly requires mutually
 exclusive groups (not groups of mutually exclusive options), i.e.,
the

What do you think about that?

Well, actually I didn't like to dream about such rocking new features
but if you are willing to add it I will be very glad to see and use
it. ;)

great :-)
then as soon as I have something ready I'll post it!

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]