[comp.os.vms] Unix / VMS: command lines

kaiser@hillst.dec.com (Systems Consultant; 297-4445) (03/26/88)

Command definitions using the command definition utility under DCL are a
service, not a requirement (except for Digital, of course).  If you feel like
using Unix-like syntax for your program's command line, just do so.  Define your
program as a "foreign command":

	$ anyoldsymbol := $disk:[directory]my-program
	$ anyoldsymbol -l something -q "MixedCase" -rtfm a b c

I know of several programs ported in one direction or another between VMS and
Unix that do this.  Parse the command line using any of several freely avail-
able packages, including getopt.  If you want to parse the command line by
another method entirely, go right ahead; your program has access to the command
line and can do with it what it wants.

But what do you get if you choose to use DCL command definition?

    1.	Every command-line argument and qualifier your program needs is
	guaranteed to have the correct syntax by the time your program sees it.

    2.	All required arguments and qualifiers are guaranteed to be present.

    3.	No conflicting arguments or qualifiers are present.

    4.	Qualifiers can be checked over the command as a whole and for each
	argument individually.

    5.	Qualifiers can be abbreviated in a standard way.

    6.  The rules are identical to the rules all Digital's commands obey, and
	the chances are good that your VMS users understand them.

    7.  These rules are well-documented.

    8.  The implementor need not write runtime code to check the syntax, com-
	pleteness, and consistency of arguments.  (Semantic adequacy is left as
	an exercise for the application.)

    9.	Such a DCL command can be defined systemwide or for individual users or
	groups of users.

   10.  If you're selling a product with a DCL interface, it can be registered
	with Digital and ensured that it won't conflict with other registered
	products.  Registration is free.

I reemphasize: the DCL interface is a service, not a requirement.  The absence
of such a service under Unix -- and the background here is well-known history --
is responsible for the chaos of Unix command lines.  This chaos will have to be
resolved, and the standards organizations are well aware of this.  I'm sure that
eventually it WILL be resolved.

Digital's VMS software uses command definition under DCL because that provides
an absolutely uniform method of expressing commands and their variants; indeed,
there is a group within Digital -- essentially a review board -- responsible for
overseeing DCL commands to ensure that, as far as possible, similar conditions
are expressed with similar qualifiers, and dissimilar conditions are NOT
expressed with similar qualifiers!  Symmetry and predictability.  Those are
virtues.  When those qualities prevail widely under Unix they'll be virtues
there as well.

---Pete

Kaiser%hillst.dec@decwrl.dec.com
decwrl!hillst.dec.com!kaiser
DEC, 3 Results Way (MRO3-3/G20), Marlboro MA 01752  617-467-4445