+ - and = in option strings

Brad Templeton brad at looking.UUCP
Mon Mar 19 15:00:00 AEST 1984


I am surprised all this debate didn't go on when I posted the
"Waterloo Command Syntax Philosophy" to this group back in the beginning.
Around here the rule is "+" turns on an option and "-" turns it off.
Options without boolean values are set by option=value or option="value"
(for strings) or option=value,value,value...

They have an almost 100% rule that options are valid anywhere on
the command line, and that unflagged operands are always the same type
of thing.  (ie. no grep string filename, it is grep "string" filename
or grep Pattern=string filename)

There was a lot of feeling that using +option and -option would be
a real pain because most options are turned on and + is a shifted character
on most terminals.

But... lo and behold when the switch was made, there was almost no complaint,
and everybody got used to it quite quickly.  You would be amazed at how
quickly people will adapt to this kind of thing.  But after all, many
common characters are shifted, like ", ' (on some) > and <, as well as
$ and many other shell metacharacters.  Hell, some systems have # for
a delete character (shifted) and multics people like using ">" as a
path character (unix slash equivalent) so people will use anything and
get used to it quickly.

In fact, these days I can't see any good reason except momentum for
unix not to switch over to a consistent, easy to learn syntax.
It can be done slowly, since as I pointed out previously, unix has no
standard or solid custom.  Why not write all new commands with a new
syntax.  We have library routines at Waterloo that make parsing command
lines of this form simple.
-- 
	Brad Templeton - Waterloo, Ontario (519) 886-7304



More information about the Comp.unix mailing list