Guidance for developers of command line utilities.
When you plan to design a utility, you must first decide what "family" it will be part of.
The word "family", in this document, refers to a distinct interface style which consists of both syntax and semantics.
Command line syntax is embodied thru routines such as
getopt(),
getopt_clip(),
popt() and the like.
Semantics refer to the user model and interaction patterns necessary to use the utility. Examples include the familiar "command from to" model used by SUS commands like "mv" and "cp".
Often, the syntax of one family is incompatible with the syntax of another family. For example, in the SUS/getopt family, "ls -lar" is the same as "ls -l -a -r", while in the Sun Compiler family, "cc -fast" is not equivalent to "cc -f -a -s t.
In the same way, the semantics of one family may be incompatible with the semantics of others. Examples run from the extreme (curses based utilities -vs- pure command line ones) to the subtle (AT&T SysV derived printing utilities might specify destination printers with -d while BSD based utilities use -P).
Often, a family is defined by a set of written guidelines, though in some cases there are none. Sometimes it is difficult to make the distinction between a family's syntax and its semantics, especially if a formal spec is lacking or poorly defined.
Being part of a family means adhering to both the syntax and semantics/idioms of that family.
The point of talking about "families" is to express the idea that maintaining consistency among a group of commands that are related together by some usage model is *MORE* important than conforming to some abstract notion of overall uniformity or some minimal definition of syntax.
It is strongly in Sun's interest to minimize the number of families that it ships, and that the arbitrary differences between such families be minimal.
If you are adding a command to an existing part of the system, you must use the family already in use by that subsystem. Some of the existing families are:
man X11)
If you are writing a new utility and you are unsure of which family you are part of, your utility should adhere to either the getopt/POSIX family or the CLIP family, which is a superset of POSIX.
Creating a new family should be done very rarely, and must be presented to the ARC for prior approval. (It is unlikely that the ARCs will approve the creation of completely new families.)
In some cases your utility may actually belong to a family that is defined outside of Sun. For example, if you were to ship a utility on AIX, you might need to conform to the family rules on that platform.
Related to the previous point, if your utility is part of an open source project, you may have little or no control over what family it belongs to. If you have questions about what to do, talk to the ARCs, your product team and with the open source experts here at Sun.