Please see the Command Line Interface Paradigm (CLIP) Companion
PSARC Case, published with the considerable help of David John Burrowes:

http://www.opensolaris.org/os/community/arc/caselog/2006/062/

This is a companion document to the CLIP Guidelines(PDF). This clarifies
some of the details in the CLIP document and describes how to solve common
design problems within that family of utilities. If your utility does not
belong to the CLIP family, these guidelines may not apply to it.

   -John




Command Line Best Practices
---------------------------

Guidance for developers of command line utilities.

When you plan to design a utility, you need to 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.

...



Reply via email to