Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utcs!mnetor!seismo!gatech!cuae2!ltuxa!ttrdc!levy From: levy@ttrdc.UUCP Newsgroups: net.lang.c Subject: Re: Question on getopt() Message-ID: <1078@ttrdc.UUCP> Date: Mon, 21-Jul-86 18:36:23 EDT Article-I.D.: ttrdc.1078 Posted: Mon Jul 21 18:36:23 1986 Date-Received: Tue, 22-Jul-86 09:06:13 EDT References: <14935@ucbvax.BERKELEY.EDU> Organization: AT&T, Computer Systems Division, Skokie, IL Lines: 30 Keywords: Message suppression In article <14935@ucbvax.BERKELEY.EDU>, kos@ernie.Berkeley.EDU (Joshua Kosman) writes: >Anybody know an easy way to intercept, suppress or otherwise get rid of the >error message that getopt() issues when user supplies an illegal flag? >It seems uncharacteristically presumptuous -- I'll write my own "Usage:" >messages myself, thanks. > Joshua Kosman GETOPT(3C) UNIX System V GETOPT(3C) ... extern int optind, opterr; ... DIAGNOSTICS Getopt prints an error message on stderr and returns a question mark (?) when it encounters an option letter not included in optstring. This error message may be disabled ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ by setting opterr to a non-zero value. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... Please, read the man page. (Note too that getopt(3) NEVER generates Usage: messages.) This message would have been mailed except I am not sure how to send mail to kos@ernie.Berkeley.EDU. -- ------------------------------- Disclaimer: The views contained herein are | dan levy | yvel nad | my own and are not at all those of my em- | an engihacker @ | ployer or the administrator of any computer | at&t computer systems division | upon which I may hack. | skokie, illinois | -------------------------------- Path: ..!{akgua,homxb,ihnp4,ltuxa,mvuxa, go for it! allegra,ulysses,vax135}!ttrdc!levy