This is the mail archive of the frysk@sourceware.org mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: Add Option Groups


Tom Tromey wrote:
"Andrew" == Andrew Cagney <cagney@redhat.com> writes:

Andrew> Good point; there's also a getopt "feature" we need to avoid, things Andrew> need to be created using the sequence:

Andrew>   - create group
Andrew>   - add group members
Andrew>   - add group to parser

Andrew> otherwise, while they show up in the help message, they don't work.
Andrew> Quick read of Parser.add(OptionGroup) shows why.

Could you spell it out?
If there is a bug, I will fix it.

Contrast it with the sequence:


  - create group
 - add group members (these are in help and work)
 - add group to parser
 - add group members (these are in help, yet don't work)

parser.add(group)'s implementation just iterates over the options in the group registered at that point (adding them to the lower-level option parser); this means options added to the group after the call, while members of the group, are not registered known to lower-level parser code. This leads to:

- -help listing the options (it's iterating over group members)
yet
- the options not appearing to work

I'm not sure if its an interface restriction, or a bug; either way it leads to a confusing client problem.

Andrew

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]