Subject: Re: Switching from old-style getopt to new-style one
To: Chris G. Demetriou <cgd@sibyte.com>
From: Jason R Thorpe <thorpej@zembu.com>
List: tech-userlevel
Date: 11/01/2000 19:34:03
On Wed, Nov 01, 2000 at 06:58:59PM -0800, Chris G. Demetriou wrote:
> Uh, as far as I know and am concerned, that is _not_ the correct
> behaviour for most programs.
>
> for instance, the syntax for 'cat' is:
>
> cat [-benstuv] [-] [file ...]
>
> and that's as it has historically been (modulo additional options,
> etc.)
>
> If you specify a file name, that is the end of option parsing, period.
>
> I don't think the new behaviour you describe should be the default for
> _any_ existing program in our source tree, unless you can provide some
> documentation (e.g. a standard like POSIX.2 or one of the X/Open ones)
> that mandates it.
Agreed -- and, in fact, it would break some programs either in the
tree now, or hitting the tree soon.
There *ARE* programs out there that do:
foo -b foocmd -cd
i.e. -cd are flags to foocmd, not foo.
--
-- Jason R. Thorpe <thorpej@zembu.com>