From owner-freebsd-arch Thu May 9 6:15:11 2002 Delivered-To: freebsd-arch@freebsd.org Received: from green.bikeshed.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id DD5D937B41E; Thu, 9 May 2002 06:15:06 -0700 (PDT) Received: from localhost (green@localhost) by green.bikeshed.org (8.11.6/8.11.6) with ESMTP id g49DF6W70696; Thu, 9 May 2002 09:15:06 -0400 (EDT) (envelope-from green@green.bikeshed.org) Message-Id: <200205091315.g49DF6W70696@green.bikeshed.org> X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: Garance A Drosihn Cc: "J. Mallett" , arch@FreeBSD.ORG Subject: Re: cvs commit: src/usr.bin/sed main.c sed.1 In-Reply-To: Your message of "Wed, 08 May 2002 19:12:40 EDT." From: "Brian F. Feldman" Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 09 May 2002 09:15:06 -0400 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 Garance A Drosihn wrote: > At 8:21 PM +0000 5/8/02, J. Mallett wrote: > >Keep in mind you're saying "-; is not a valid option", > >which while in practice may be safe, may not be the best > >thing to say. > > But consider, for instance: > > /bin/echo test -? somestring > vs: /bin/echo test -; somestring > > if you don't quote the '-;', then the shell will use it > as a command-separator before the command ever sees it. > This seems to be true with sh, csh, and bash on my > freebsd-current system. This makes '-;' a very awkward > flag for a command to use. Seems like a nice extension > to getopt(3). It really does seem, though, that lots of applications reimplement getopt(3) (incorrectly) in order to have one or two "frivolous" features. Applications which take -o[optarg] and -o [several] [args] seem to be none-too-uncommon. I'd want to try to support them just so that they all don't reinvent getopt(3) badly, but then again there's the problem that other operating systems would have to adopt the extended getopt syntax, too. Lots of applications just use getopt_long(3) instead, which I suppose can easily allow for this functionality with GNU arguments just by virtue that they cannot be concatenated anyway. My temptation is not to provide the functionality in the system's libraries because that would tend to make developers actually use it, and in doing so become unportable to those OSes having a different getopt(3) in addition to going against the grain of what POSIX wants. I don't think there's a clean way of doing it without a modified getopt, so I'd say that either sed should have its own getopt with that change locally or it would just fail to support the Perl syntax. -- Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\ <> green@FreeBSD.org <> bfeldman@tislabs.com \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message