-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Elan Ruusamäe on 5/25/2007 4:45 AM: > `yes` from coreutils is incompatible with coreutils 5.2.1: > > 5.2.1: > $ yes -v | head -n3 > -v > 6.9: > $ yes -- -v | head -n3 > -v
Indeed. And this was mentioned in the NEWS, so it was intentional. > so how this can be invalid option if there is no short options at all in yes > binary (nor in manual or --help output) The reason the change was made is because of POSIX, which states that all new applications should follow the application option parsing guidelines, one of which is that -- should be the end-of-options delimiter. Just because yes currently doesn't support options does not mean that it won't in the future, so yes is actually more reliable by treating all leading - as options if the -- is missing, then complaining loudly that the option is not recognized, than it is to silently treat it as literal text and then breaking if the text is turned into an option at a later date. The ONLY coreutils which do not follow this guideline are the ones specified by POSIX (such as echo and test) as being exceptions to the POSIX option guidelines, and that is because of backwards compatibility issues. > > with such incompatabilities it's not possible to write portable code :/ 'yes' is not specified by any standards, so it is not portable to begin with. If you want to use yes in a script, and want to guarantee that it will work across 5.2.1 and 6.x, then you will have to do a feature test to determine whether the -- is necessary; in fact, it can be part of the same feature test that determines if yes is even available. - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGVtAw84KuGfSFAYARAjEjAJ4mLRFKK8Aa1GNLIw3yS5Zy9oUGYgCfYyvn gCKox9gzA5nI49p8fNhYGBs= =C7c9 -----END PGP SIGNATURE----- _______________________________________________ Bug-coreutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-coreutils
