From owner-freebsd-arch Sun Dec 23 1:36:58 2001 Delivered-To: freebsd-arch@freebsd.org Received: from titanic.uninet.kiev.ua (titanic.uninet.kiev.ua [193.125.78.35]) by hub.freebsd.org (Postfix) with ESMTP id 71E8B37B405 for ; Sun, 23 Dec 2001 01:36:53 -0800 (PST) Received: (from uucp@localhost) by titanic.uninet.kiev.ua (8.11.1/8.11.1) with UUCP id fBN9aj214703; Sun, 23 Dec 2001 11:36:45 +0200 (EET) (envelope-from ura@sphinx.univ.kiev.ua) Received: by sphinx.univ.kiev.ua (Postfix, from userid 1001) id C117C59201; Sun, 23 Dec 2001 11:35:44 +0200 (EET) Date: Sun, 23 Dec 2001 11:35:44 +0200 From: Yuri Karaban To: Peter Wemm Cc: freebsd-arch@freebsd.org Subject: Re: gnu getopt in libc Message-ID: <20011223093544.GA27632@sphinx.univ.kiev.ua> References: <20011222132030.GA19596@sphinx.univ.kiev.ua> <20011222201930.B9DEF38CC@overcee.netplex.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20011222201930.B9DEF38CC@overcee.netplex.com.au> User-Agent: Mutt/1.3.24i Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, Dec 22, 2001 at 12:19:30PM -0800, Peter Wemm wrote: > > gnu getopt supports long options and can reorder option keys > > so i can write: > > some_program -a -b -c file1 file2 -d -e -f > > > > FreeBSD getopt in libc very simple it can recoginze only one letter > > arguments, does not support optional arguments and arguments to > > program may appear only at the beginning. > > > > so why dont replace libc/stdlib/getopt.c by gnu version ? > > 1) because it is nonstandard You mean that some programs relies on the fact that -d -e -f are files also ? There is a solution, if the NEW_GETOPT environment varaible is set, act as gnu getopt, and people who want the old behavior (or their scripts/programs require that) simply should not set this variable. > 2) it is GPL contaminated which we cannot use in libc. This is not the problem, someone (maybe me) can write it, getopt with the same functionality. PS. If I want to write a new getopt function, isn't my work futile ? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message