donn@sdchema.UUCP (03/25/84)
What has not been mentioned is that Unix DOES support a standard name=value syntax for passing information to programs: namely, the Bourne Shell syntax for assigning to environment variables. With the proper option decoder one could arrange to get either 'name=value' or '-n value' options, and without ambiguity -- 'name=value' appears to the left of the command, '-n value' to the right. You might imagine being able to issue a compile two ways: $ cc -O -DDEBUG -s -o foo foo.c or $ optimizer=on define=DEBUG strip=on output=foo cc foo.c In fact there would be several nice side effects to using environment variables for setting options. For example, environment variables can be sticky: $ mt -f /dev/rmt0 fsf 1 $ tar xvf /dev/rmt0 file $ mt -f /dev/rmt0 fsf 1 could instead be $ tape=/dev/rmt0 $ export tape $ mt fsf 1 $ tar xv file $ mt rew Another advantage is that environment variables are inherited -- if you are running a program which calls other programs, you can pass options to these subsidiary programs with environment variables. In the case of the C compile above, the compiler wouldn't have to make any special arrangements to pass 'strip=on' to the loader, unlike the current way things are done where an argument list must be re-formulated for each subprogram. And notice that the operating system and libraries and shell need not change to implement this scheme... Alas, some sort of consistent option parsing must be enforced. I doubt this will satisfy either faction, Donn Seeley UCSD Chemistry Dept. ucbvax!sdcsvax!sdchema!donn 32 52' 30"N 117 14' 25"W (619) 452-4016 sdcsvax!sdchema!donn@nosc.ARPA
dave@utcsrgv.UUCP (Dave Sherman) (03/26/84)
I like Donn's suggestion. However, there has to be a simple way of examining the currently-set environment variables (they may have been set in a .profile you don't know about, or several hours ago on a long terminal session) which will be relevant to a particular command. Dave Sherman Toronto utcsrgv!dave -- {allegra,cornell,decvax,ihnp4,linus,utzoo}!utcsrgv!dave