Question on getopt()

Mark Purtill purtill at petrus.UUCP
Sat Jul 26 07:55:38 AEST 1986


In article <1078 at ttrdc.UUCP>, levy at ttrdc.UUCP (Daniel R. Levy) writes:
> In article <14935 at ucbvax.BERKELEY.EDU>, kos at 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?
...
>      GETOPT(3C)		       UNIX System V		    GETOPT(3C)
...
> 	  included in optstring.  This error message may be disabled
>                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 	  by setting opterr to a non-zero value.
>           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>      ...
> Please, read the man page.
...

Not that the man page we have here (seems to be BSB 4.3) does not have the
sentence marked with ^^^^s for a very good reason:  its not true.  Under
4.3 you can't suppress the messages except by rewriting getopt. Why did 
you(dan) assume someone from Berkeley was using sys V?

            mark purtill            (201) 829-5127
^.-.^ Arpa: purtill at bellcore.com    435 south st 2H-307
((")) Uucp: ihnp4!bellcore!purtill  morristown nj 07960



More information about the Comp.lang.c mailing list