Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Jun 1999 10:12:40 +0200 (METDST)
From:      hm@hcs.de (Hellmuth Michaelis)
To:        bde@zeta.org.au (Bruce Evans)
Cc:        hm@hcs.de, imp@FreeBSD.org, cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org
Subject:   getopt -? illegal ? (was: cvs commit: src/usr.sbin/i4b/isdnd main.c ..)
Message-ID:  <m10x4ci-0000fkC@hcswork.hcs.de>
In-Reply-To: <199906240726.RAA29454@godzilla.zeta.org.au> from Bruce Evans at "Jun 24, 99 05:26:04 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
From the keyboard of Bruce Evans:

> >>   	o getopt returns '?' for characters it doesn't know about, so
> >>   	  don't include them in the getopt options string.
> >
> >Including '?' in the getopt options string is intentional, because - last
> >time i checked - using "programname -?" produces an output, where getopt
> >says that "-?" is an invalid option. This is IMHO false in that "-?" is
> >a valid option to display the usage string(s).
> 
> "-?" is an invalid option that can be (ab)used to display the usage
> message.  It is clearly invalid for the i4b programs because none of the
> i4b man pages document it :-).  Documenting it in all man pages wouldn't
> be useful.
> 
> getopt actually says that "-?" is an illegal option.

Since the very first days i learned Unix, i was - and i still am - under the
impression that running a program with -? produces a usage message.

I still think that this is common sense, usage and knowledge.

Am i wrong ???

Given that i'm wrong, what is the common, known and valid flag to produce
a usage message, -h ?

hellmuth
-- 
Hellmuth Michaelis                                    Tel   +49 40 559747-70
HCS Hanseatischer Computerservice GmbH                Fax   +49 40 559747-77
Oldesloer Strasse 97-99                               Mail  hm [at] hcs.de
22457 Hamburg                                         WWW   http://www.hcs.de


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?m10x4ci-0000fkC>