Xref: utzoo comp.lang.c:9444 comp.unix.wizards:7844 Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!pasteur!ucbvax!decvax!mandrill!hal!ncoast!allbery From: allbery@ncoast.UUCP (Brandon Allbery) Newsgroups: comp.lang.c,comp.unix.wizards Subject: Re: command line options Message-ID: <7616@ncoast.UUCP> Date: 17 Apr 88 19:26:31 GMT References: <2414@zyx.UUCP> <8039@elsie.UUCP> <7628@brl-smoke.ARPA> <143@gsg.UUCP> Reply-To: allbery@ncoast.UUCP (Brandon Allbery) Followup-To: comp.lang.c Organization: Cleveland Public Access UN*X, Cleveland, Oh Lines: 22 As quoted from <143@gsg.UUCP> by lew@gsg.UUCP (Paul Lew): +--------------- | In article <7628@brl-smoke.ARPA>, gwyn@brl-smoke.ARPA (Doug Gwyn ) writes: | > Under the existing getopts scheme, typing | > command -? | > is guaranteed to get the usage message. | | Why use '?' character? I especially hate to type: command '-?' to avoid | '?' to be expanded by shell. In Bourne shell, if you dont have any file +--------------- (1) To the person who couldn't find "getopts" in the manual: it's "getopt", without the "s". Try "man 3 getopt" -- if Berkeley got around to putting it into libc, that is. (2) The point is not that "-?" is magic, it's that any unknown option will elicit a usage message. I personally use "-." to get the usage message, since I have yet to see a program which uses "-." as an option. Whereas some programs *do* use -H (System V /bin/who, for instance). -- Brandon S. Allbery, moderator of comp.sources.misc {well!hoptoad,uunet!marque,cbosgd,sun!mandrill}!ncoast!allbery Delphi: ALLBERY MCI Mail: BALLBERY