Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utcs!mnetor!seismo!lll-crg!topaz!husc6!harvard!panda!genrad!decvax!cca!g-rh From: g-rh@cca.UUCP Newsgroups: net.decus,net.unix,net.usenix Subject: Re: Favorite operating systems query (UNIX vs VMS flaming!!!) Message-ID: <8804@cca.UUCP> Date: Wed, 9-Jul-86 02:28:09 EDT Article-I.D.: cca.8804 Posted: Wed Jul 9 02:28:09 1986 Date-Received: Sun, 13-Jul-86 20:24:42 EDT References: <486@batcomputer.TN.CORNELL.EDU> <1000@ttrdc.UUCP> <873@rti-sel.UUCP> Reply-To: g-rh@cca.UUCP (Richard Harter) Organization: Computer Corp. of America, Cambridge Lines: 48 Xref: utcs net.decus:417 net.unix:8574 net.usenix:656 Summary: Confusion on VMS program argument processing In article <> friesen@psivax.UUCP (Stanley Friesen) writes: >In article <873@rti-sel.UUCP> rcb@rti-sel.UUCP (Random) writes: >> >>>Most Unix programs will print out a line or so of "usage" diagnostics if you >>>invoke them with bogus arguments. Do VMS programs do this? >>> >> >>No. VMS programs will not let you invoke them with bogus arguments. Since >>the arguments are parsed by DCL before the program is invoked, if you give >>too many parameters or an unknown switch DCL will reject it with an error >>message that points out the specific problem. > > Oh, *great*:-) How does the DCL parse the arguments for a user >written application program?? I can't see how it can do this without >some rather messy interface requirements. This really sounds like a >way to make user-written programs second class citizens on the system. >I think the individual program is better qualified to analyse its own >arguments, whay is really needed is a *standard* for this, like getopts(3)! I'm not a VMS guru but I know enough to know that this is all getting a little confused. VMS programs which are not installed can be executed either with RUN or MCR. RUN is a general utility for executing a user application program; MCR is another such utility with somewhat different rules. In particular, arguments cannot be passed to programs invoked using RUN; however they can for programs invoked using MCR. System programs take options in the form of switches. Thus: run xyz mcr xyz arg1 arg2 arg3 dir/col=1 [DIR is the equivalent of ls. The slash signifies a switch (option). In this case the output is one column per line.] I don't know the rules for creating commands using switches. (My impression is that is done as part of installation -- but I just don't know.) In any case the DCL switch parser is the equivalent for VMS of getopts for publicly known programs. The difference is that you have to describe to the system what rules your options (switches) follow if your program is a public program. When your program is invoked the DCL validates the arguments before the program is brought up. DISCLAIMER -- this is just my impression; someone with VMS systems experience should clarify the matter. However, if my understanding is correct, then this is a perfectly reasonable way to do things -- I would count it as preferable since it insists that options in public (system wide) utilities be handled in a standardized manner. Richard Harter SMDS Inc.