From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2811 invoked by alias); 26 Jul 2007 20:24:55 -0000 Received: (qmail 2801 invoked by uid 22791); 26 Jul 2007 20:24:54 -0000 X-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DK_POLICY_SIGNSOME,SPF_HELO_PASS,SPF_PASS,TW_FH 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, 26 Jul 2007 20:24:52 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l6QKOoF2011078 for ; Thu, 26 Jul 2007 16:24:50 -0400 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l6QKOo7g032522 for ; Thu, 26 Jul 2007 16:24:50 -0400 Received: from tow.toronto.redhat.com (tow.toronto.redhat.com [172.16.14.160]) by pobox.toronto.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id l6QKOnlV024276 for ; Thu, 26 Jul 2007 16:24:49 -0400 Message-ID: <46A90311.8080601@redhat.com> Date: Thu, 26 Jul 2007 20:24:00 -0000 From: Nurdin Premji User-Agent: Thunderbird 2.0.0.5 (X11/20070719) MIME-Version: 1.0 To: Frysk List Subject: Fhpd Commands option parsing Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 2007-q3/txt/msg00202.txt.bz2 I am creating a small option parser based on the getopt option parser for fhpd commands, (okay so the only thing being carried over is the Options class). I want to avoid having to do too many fancy things to add extra options, I like the ability to say parser.addOption and have it know what to do. I'd also like a standard help option for each command that doesn't exit the fhpd when run. I'm making a few assumptions about the possible options for the fhpd internal commands: 1. All options are at the end. I.e. command [parameters ...] [options ...] 2. No option has arguments. Are these safe assumptions? Are there more I can count on?