From owner-svn-src-head@FreeBSD.ORG Thu Sep 16 21:42:03 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDCAC1065672; Thu, 16 Sep 2010 21:42:03 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 7CF878FC08; Thu, 16 Sep 2010 21:42:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o8GLSju1008340; Thu, 16 Sep 2010 15:28:45 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 16 Sep 2010 15:28:54 -0600 (MDT) Message-Id: <20100916.152854.856152966653228621.imp@bsdimp.com> To: jmallett@FreeBSD.org From: "M. Warner Losh" In-Reply-To: References: <20100916084442.GB21622@dragon.NUXI.org> <20100916212043.N724@delplex.bde.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, obrien@FreeBSD.org, brde@optusnet.com.au Subject: Re: svn commit: r212374 - head/usr.bin/printf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 21:42:03 -0000 In message: Juli Mallett writes: : On Thu, Sep 16, 2010 at 04:36, Bruce Evans wro= te: : > WHat about the lesser burder on a character or two for putting -- i= n the : > synopsis where it is more visible: : > : > =A0 =A0 =A0 =A0printf [--] format [arguments ...] : = : Right, that's what I've been thinking about. For that matter, does : printf(1) need to use getopt(3) at all? It seems like simply checkin= g : for "--" could be sufficient. Does POSIX require that it exit with a= n : error if it's given any options? At the very least, it seems like it= : would be more productive to have printf(1) give unusually-helpful : error messages (perhaps merely changing its usage output to match tha= t : synopsis) if it encounters a string beginning with '-' other than : "--". if (getenv("POSIX_ME_HARDER") && arg[0] =3D=3D '-' && arg[1] !=3D '-')= errx(1, "Strict posix compliance says you lose."); might be all that's needed. Warner