Xref: utzoo comp.lang.c:9143 comp.unix.wizards:7699 Path: utzoo!utgpu!utcsri!flaps From: flaps@utcsri.UUCP (Alan J Rosenthal) Newsgroups: comp.lang.c,comp.unix.wizards Subject: Re: command line options Message-ID: <5982@utcsri.UUCP> Date: 11 Apr 88 06:09:32 GMT Article-I.D.: utcsri.5982 Posted: Mon Apr 11 02:09:32 1988 References: <2414@zyx.UUCP> <8039@elsie.UUCP> <7628@brl-smoke.ARPA> <143@gsg.UUCP> <7634@brl-smoke.ARPA> <21370@bu-cs.BU.EDU> <7639@brl-smoke.ARPA> <21419@bu-cs.BU.EDU> Reply-To: flaps@dgp.toronto.edu (Alan J Rosenthal) Distribution: world Organization: University of Toronto Lines: 26 Summary: Suppose you have a command, and it has a -h option which takes a filename argument, as in "command -h file". This is certainly reasonable. Suppose you have a file in your current directory named `elp'. This is not a weird file name. Suppose you therefore invoke the command as "command -h elp" or "command -help". Amusing, but syntactically correct. In article <21419@bu-cs.BU.EDU> bzs@bu-cs.BU.EDU (Barry Shein) writes: >What's wrong with using "-help" as a special case? This. The above command, although it worked fine for files `ela' through `elo', doesn't work for `elp'. In general, unix options are too terse to be likely to have a syntactic hole large enough to put a whole word through. We should be grateful that the implementation of getopt() guarantees (accidently, I'm sure) that "command '-?'" works. ajr -- "Don't put things you find on the street into your mouth."