Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 May 2002 20:21:32 +0000
From:      "J. Mallett" <jmallett@FreeBSD.ORG>
To:        Garance A Drosihn <drosih@rpi.edu>
Cc:        "Brian F. Feldman" <green@FreeBSD.ORG>, "J. Mallett" <jmallett@FreeBSD.ORG>, arch@FreeBSD.ORG, Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
Subject:   Re: cvs commit: src/usr.bin/sed main.c sed.1
Message-ID:  <20020508202131.GC19530@FreeBSD.ORG>
In-Reply-To: <p0511174bb8ff15c41118@[128.113.24.47]>
References:  <200205080304.g4834BL42647@green.bikeshed.org> <p0511174bb8ff15c41118@[128.113.24.47]>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, May 08, 2002 at 02:32:28PM -0400, Garance A Drosihn wrote:
> At 11:04 PM -0400 5/7/02, Brian F. Feldman wrote:
> >Trying to move this to arch:
> 
> ...certainly a good idea.
> 
> >Another option would be to extend getopt(3) in what could
> >simply be a very reasonable way.  Here's my proposition
> >for making a "clean" version that acts like Perl:
> 
> I must admit that I kind of like the idea of modifying
> getopt(3) so that it has the ability to process optional
> attached-arguments to a command flag.  There are older
> programs which have such options, and it would be nice
> if those programs could use a common routine for all
> their processing.  I expect that I shouldn't like that, as
> it means we've deviated getopt(3) from how it is defined
> in the standards, but I'll admit I like the idea.  Your
> idea of using ';' for the flag (to getopt) that indicates
> an optional argument seems like a very good choice, too.

I prefer "XX:", but that's a stylistic nit, I suppose.  I
would rather not introduce a new internal flag as such tho,
as 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.

XX: would not affect anything.

> This then suggests we need two command-flags, one which
> always takes an argument and one which never takes one.
> As to which-is-which, or what the implied argument is
> for the flag which never takes an argument, I like -i
> for the flag which never takes an argument, and having
> -i mean the same as '-I ""', but I'd be equally happy
> with any other combination just as long as we are not
> adding a command-flag that takes an optional argument.
> 
> I think this -i/-I idea is good enough that many others
> would pick up on it when they see it, and it makes
> sense to define it in a way that doesn't conflict with
> what standards-groups have already said about options.

GNU implemented -i for xargs(1), in the way that I wanted
to do compatability for.  This option occurs in NEXTSTEP3.3
xargs(1), I do not know where it originates.  SysV apparently
has it...  They also introduced '-I' which *required* an arg,
and that was picked up by SUS/POSIX.

I think if we don't do that we're being fools, and selling short
our wonderful new capability for sed(1) [not that it matters, I
just love being proud of work I've done].
-- 
jmallett@FreeBSD.org   | C, MIPS, POSIX, UNIX, BSD, IRC Geek.
http://www.FreeBSD.org | The Power to Serve
"I've never tried to give my life meaning by demeaning you."

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020508202131.GC19530>