-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Mikhail Teterin on 9/21/2006 6:57 AM: > > When using the short options, please, stick to the POSIX-provided semantics.
GNU m4 (and many other GNU utilities using getopt_long or argp) already do just that. For the three short options required by POSIX, (-s with no argument, and -D and -U with arguments), m4 parses according to POSIX requirements (and for -D and -U, a space between the option and its argument is optional). For all other options, short or long, they are extensions to POSIX, and POSIX allows GNU m4 to assign whatever semantics we want, so long as we comply with the guidelines of POSIX option parsing (http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02, plus read up on the Austin group mailing list for how this section will likely be changing in the next revision of POSIX). That means we are free to have -d take an optional argument, in which case there must not be a space between the short option and its argument, if the argument is provided. Just because POSIX discourages optional arguments on the options it requires (in part because the getopt interface it requires does not support them) does not mean it forbids them on extensions. > > Finally, does m4 actually use/document the short-options usage, that's > affected by the POSIX vs. GNU differences in getopt()? Yes, the info documentation for m4's -d discusses the ramifications of its argument being optional (and if that text is not clear enough for you, please report it as a bug so we can improve it). - -- Life is short - so eat dessert first! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.1 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFEpVZ84KuGfSFAYARAkCxAJ9cx8djT0nDd/wWjBvPJceMoEGtxQCcCaJ+ Bt3BIiFhU+fzRQ+Ok6qSMOs= =1ug5 -----END PGP SIGNATURE-----