Subject: Re: Option to make cpp(1) not accept named pipes or devices as
To: None <tech-toolchain@netbsd.org>
From: Christos Zoulas <christos@zoulas.com>
List: tech-toolchain
Date: 11/29/2004 22:29:37
In article <Pine.NEB.4.60.0411291645360.3140@himring.draga.com>,
Jim Wise <jwise@draga.com> wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>On Mon, 29 Nov 2004, Hubert Feyrer wrote:
>
>> On Mon, 29 Nov 2004, Jim Wise wrote:
>>> Any suggested improvements before I do so?
>>
>> Add a command line switch? It's the unix way of altering command behaviour...
>
>Eh?  From $PATH to $EDITOR to $TERM, lot's of programs alter their 
>behavior based on environment variables.
>
>More specifically, I'm somewhat hesitant to use a flag in this case.  
>
>My main concern is that this will be most often used by programs 
>exec'ing cpp, and not all of them will be smart about allowing arguments 
>to be part of ${CPP}, so an environment variable provides a saner way to 
>modify cpp's behavior when called from an already-existing binary or 
>script.
>
>There's also the concern that if users decide to use a non-basesrc cpp 
>(as _many_ users do via pkgsrc/lang/gcc34), a new command line option 
>will cause cpp to fail outright, while a new environment variable will 
>not.
>
>That's why I chose the route I did, anyway...

The problem with the environment variable approach is that there is no
user feedback if the variable did something or not. With a flag the program
can exit with a usage message indicating to the caller that this option
is not supported.

christos