From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9373 invoked by alias); 19 Mar 2008 07:46:59 -0000 Received: (qmail 9365 invoked by uid 22791); 19 Mar 2008 07:46:58 -0000 X-Spam-Status: No, hits=-2.3 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; Wed, 19 Mar 2008 07:46:41 +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 m2J7kdUd026629 for ; Wed, 19 Mar 2008 03:46:39 -0400 Received: from pobox-2.corp.redhat.com (pobox-2.corp.redhat.com [10.11.255.15]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m2J7kcmK029025; Wed, 19 Mar 2008 03:46:38 -0400 Received: from localhost.localdomain (vpn-15-121.rdu.redhat.com [10.11.15.121]) by pobox-2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m2J7kbIN023152; Wed, 19 Mar 2008 03:46:38 -0400 Message-ID: <47E0C4DC.2080609@redhat.com> Date: Wed, 19 Mar 2008 07:46:00 -0000 From: Phil Muldoon User-Agent: Thunderbird 2.0.0.12 (X11/20080226) MIME-Version: 1.0 To: Andrew Cagney CC: Frysk Hackers Subject: Re: Patch: Add Option Groups References: <47DFFE9D.80906@redhat.com> <47E021DF.40407@redhat.com> In-Reply-To: <47E021DF.40407@redhat.com> 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/msg00165.txt.bz2 Andrew Cagney wrote: > Phil, > > public CommandlineParser(String name, String version) { > > I'd either: > > create the utility specific group, and then the standard frysk option > group and all the standard frysk options here; and then have "add" add > to the utility specific group - since group order comes first things > will be as expected Don't know the name of the group so far ahead of time. The Option group name has to be created at group creation time. And I really want the freedom given to the user to create as many groups as they like, so complex utilities like ftrace can have many groups. > > or > > add an abstract method to get the options to CommandLineParser and > have the extensions implement that - it can then be called before the > standard frysk options group is created > Still going to have to have the build custom options, then build standard options call somewhere in CommandlineParser unless we tell the user to explicitly to include the default options themselves. Also means a relationship change. Right now CommandlineParser is called, not extended. Nevertheless something like: public abstract buildCustomOptions then in subclass buildCustomOptions { OptionGroup foo = new OptionGroup("Foo Group"); parser.add(foo). foo.add(new Option(...)) OptionGroup foo2= new OptionGrouo("Extended Foo Group"); parser.add(foo2). foo2.add(new Option(...)) ... ... ... super.buildDefaultOptions() ; } Something like this?