In message: <aanlktimjfexdp_9caoqbg3wpxpbglrutdzbw+xm6v...@mail.gmail.com> Juli Mallett <jmall...@freebsd.org> writes: : On Thu, Sep 16, 2010 at 04:36, Bruce Evans <b...@optusnet.com.au> wrote: : > WHat about the lesser burder on a character or two for putting -- in the : > synopsis where it is more visible: : > : > printf [--] 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 checking : for "--" could be sufficient. Does POSIX require that it exit with an : 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 that : synopsis) if it encounters a string beginning with '-' other than : "--".
if (getenv("POSIX_ME_HARDER") && arg[0] == '-' && arg[1] != '-') errx(1, "Strict posix compliance says you lose."); might be all that's needed. Warner _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"