Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Jun 1999 16:57:47 +0930
From:      Greg Lehey <grog@lemis.com>
To:        Warner Losh <imp@harmony.village.org>
Cc:        hm@hcs.de, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/usr.sbin/i4b/isdnd main.c src/usr.sbin/i4b/isdndebug main.c src/usr.sbin/i4b/isdndecode main.c src/usr.s
Message-ID:  <19990624165747.A427@freebie.lemis.com>
In-Reply-To: <199906240719.BAA36122@harmony.village.org>; from Warner Losh on Thu, Jun 24, 1999 at 01:19:57AM -0600
References:  <m10x3JA-0000fPC@hcswork.hcs.de> <199906240719.BAA36122@harmony.village.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday, 24 June 1999 at  1:19:57 -0600, Warner Losh wrote:
> In message <m10x3JA-0000fPC@hcswork.hcs.de> Hellmuth Michaelis writes:
> : 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).
>
> I'm not sure I agree with that completely.  '?' is never used in BSD
> 4.4-lite sources (as far as I recall), but the 4.4-lite files also
> compared against EOF rather than -1.  '?' is a special character to
> getopt.  Users of getopt have no way of knowing if the user typed '?'
> or some other character, since getopt maps unknown characters to '?'.
> Since '?' is a special character, I don't have a problem adding it to
> the list of characters that are treated specially.  Right now ':' is
> treated specially in getopt's error reporting.  This is a deviation
> form the documentation, so there is precidence for treating ?
> specially.

It seems to me that -? is a dangerous flag.  Consider:

 echo rm -?
 touch ./-f
 echo rm -?

Greg
--
See complete headers for address, home page and phone numbers
finger grog@lemis.com for PGP public key


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?19990624165747.A427>