Xref: utzoo comp.lang.c:9042 comp.unix.wizards:7656 Path: utzoo!mnetor!uunet!husc6!think!ames!oliveb!sun!gorodish!guy From: guy@gorodish.Sun.COM (Guy Harris) Newsgroups: comp.lang.c,comp.unix.wizards Subject: Re: command line options Message-ID: <48917@sun.uucp> Date: 8 Apr 88 22:37:19 GMT References: <2414@zyx.UUCP> <8039@elsie.UUCP> <7628@brl-smoke.ARPA> <143@gsg.UUCP> <7634@brl-smoke.ARPA> Sender: news@sun.uucp Lines: 21 > You miss the point; -? already has the desired property; it does not > have to be explicitly added to every application. That's news to me; if you're talking about the "getopt()" subroutine, you must be talking about an implementation other than the System V Release 3.1 implementation, because that one sure doesn't cons up a usage message for you if you provide the '-?' option. In fact, I can't see how it *can* cons up a complete usage message; the best it can do is tell you what options it expects - it can't tell you that it expects two file names, a number from 1 to 10, and the air speed of a laden swallow. While the code to *recognize* '-?' doesn't have to be explicitly added to every application using "getopt()", the code to respond to it and print a usage message does. > I'm sorry if you choose to use a shell that makes this too difficult to type. Relying on the Bourne/Korn shell not expanding some string containing a pattern-matching metacharacter because you "know" there are no files that match that string is dangerous (although I do it anyway...). You may someday find that there *is* such a file.