From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8085 invoked by alias); 20 Mar 2008 16:09:32 -0000 Received: (qmail 8054 invoked by uid 22791); 20 Mar 2008 16:09:29 -0000 X-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 20 Mar 2008 16:08:53 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m2KG8oSX018969 for ; Thu, 20 Mar 2008 12:08:50 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m2KG8n2e022065; Thu, 20 Mar 2008 12:08:49 -0400 Received: from localhost.localdomain (sebastian-int.corp.redhat.com [172.16.52.221]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m2KG8mf8030679; Thu, 20 Mar 2008 12:08:48 -0400 Message-ID: <47E28BF9.5020400@redhat.com> Date: Thu, 20 Mar 2008 16:09:00 -0000 From: Andrew Cagney User-Agent: Thunderbird 2.0.0.12 (X11/20080226) MIME-Version: 1.0 To: Tom Tromey CC: Phil Muldoon , Frysk Hackers Subject: Re: Patch: Add Option Groups References: <47DFFE9D.80906@redhat.com> <47E021DF.40407@redhat.com> <47E0C4DC.2080609@redhat.com> <47E24FB8.7090507@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2008-q1/txt/msg00177.txt.bz2 Tom Tromey wrote: >>>>>> "Andrew" == Andrew Cagney 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 >