From owner-cvs-all Thu Jun 24 1:12:48 1999 Delivered-To: cvs-all@freebsd.org Received: from hcsext.hcs.de (hcshh.hcs.de [194.123.40.1]) by hub.freebsd.org (Postfix) with SMTP id 74584151C2; Thu, 24 Jun 1999 01:12:42 -0700 (PDT) (envelope-from hm@hcs.de) Received: from hcswork.hcs.de([192.76.124.5]) (2362 bytes) by hcsext.hcs.de via sendmail with P:smtp/R:inet_hosts/T:smtp (sender: ) id for ; Thu, 24 Jun 1999 10:12:41 +0200 (CEST) (Smail-3.2.0.104 1998-Nov-20 #1 built 1998-Dec-11) Received: by hcswork.hcs.de (Smail3.1.29.0 #12) id m10x4ci-0000fkC; Thu, 24 Jun 99 10:12 METDST Message-Id: From: hm@hcs.de (Hellmuth Michaelis) Subject: getopt -? illegal ? (was: cvs commit: src/usr.sbin/i4b/isdnd main.c ..) In-Reply-To: <199906240726.RAA29454@godzilla.zeta.org.au> from Bruce Evans at "Jun 24, 99 05:26:04 pm" To: bde@zeta.org.au (Bruce Evans) Date: Thu, 24 Jun 1999 10:12:40 +0200 (METDST) Cc: hm@hcs.de, imp@FreeBSD.org, cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Reply-To: hm@hcs.de Organization: HCS Hanseatischer Computerservice GmbH X-Mailer: ELM [version 2.4ME+ PL39 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 1383 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk 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