Path: utzoo!attcan!lsuc!eci386!jmm From: jmm@eci386.uucp (John Macdonald) Newsgroups: comp.lang.c Subject: Re: getopt Message-ID: <1989Jun19.153426.21238@eci386.uucp> Date: 19 Jun 89 15:34:26 GMT References: <782@crdgw1.crd.ge.com> <13730@haddock.ima.isc.com> Reply-To: jmm@eci386.UUCP (John Macdonald) Organization: R. H. Lathwell Associates: Elegant Communications, Inc. Lines: 24 In article <13730@haddock.ima.isc.com> karl@haddock.ima.isc.com (Karl Heuer) writes: }In article <782@crdgw1.crd.ge.com> davidsen@crdos1.UUCP (bill davidsen) writes: }>I have a program which needs an option which may have either a default }>value or a specific value. ie. "-c" or "-c4" would be typical. I would }>like to use getopt to read the values. } }This doesn't fit the Official Arg Passing Style, so even if you use a hook a }kludge into getopt(), it isn't guaranteed to always work. } } [...] } }"-#" is a not uncommon debugging option. I think ";" is a better choice, }since it does half of what ":" does%, and because I don't know of any code }that uses "-;" as an option. } }Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint }________ }% This pun works only if you pronounce them as "semicolon" and "colon". Surely it would be better (except for punning purposes) to use -? to indicate an optional argument. Getopt precludes having a useful ? option since the return of ? indicates an error occurred. The ? is also suggests that the option is "conditionally present".