POSIX requires "test --help" and "test --version" to succeed silently,
and coreutils conforms to POSIX in this respect.  It was thought more
useful for "test" to work the same way on every nonempty string, than
for it to add incompatible support for "--help" and "--version".

"[ --help" and "[ --version" will output help and version messages,
though, so you can use that instead.  This is an upward compatible
extension to POSIX.

"true --help" and "true --version" do work in coreutils 5.93; this was
fixed a while ago.

The business about "test --help" is explained in the coreutils 5.93
manual, as follows:

   If EXPRESSION is omitted, `test' returns false.  If EXPRESSION is a
   single argument, `test' returns false if the argument is null and true
   otherwise.  The argument can be any string, including strings like
   `-d', `-1', `--', `--help', and `--version' that most other programs
   would treat as options.  To get help and version information, invoke
   the commands `[ --help' and `[ --version', without the usual closing
   brackets.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to