public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Cagney <cagney@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: Phil Muldoon <pmuldoon@redhat.com>, Frysk Hackers <frysk@sourceware.org>
Subject: Re: Patch: Add Option Groups
Date: Thu, 20 Mar 2008 16:09:00 -0000	[thread overview]
Message-ID: <47E28BF9.5020400@redhat.com> (raw)
In-Reply-To: <m3d4pptthc.fsf@fleche.redhat.com>

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
>   

  reply	other threads:[~2008-03-20 16:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-18 17:41 Phil Muldoon
2008-03-18 18:28 ` Tom Tromey
2008-03-19  7:51   ` Phil Muldoon
2008-03-19 13:23     ` Tom Tromey
2008-03-18 20:11 ` Andrew Cagney
2008-03-19  7:46   ` Phil Muldoon
2008-03-20 11:52     ` Andrew Cagney
2008-03-20 14:23       ` Tom Tromey
2008-03-20 16:09         ` Andrew Cagney [this message]
2008-03-20 18:06           ` Tom Tromey
2008-04-01 21:36             ` Andrew Cagney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47E28BF9.5020400@redhat.com \
    --to=cagney@redhat.com \
    --cc=frysk@sourceware.org \
    --cc=pmuldoon@redhat.com \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).