Subject: Re: bug#20514: Patch to tie --help and --version behavior to POSIXLY_CORRECT

From: Pádraig Brady <[email-masked]>
Date: Wed, 06 May 2015 17:16:53 +0100

On 06/05/15 16:40, Shawn McMahon wrote:
> The following patch to "test" ties the behavior of "--help" and "--version" to POSIXLY_CORRECT. I don't believe this breaks anything, and if it does it can by fixed by setting the time-honored variable. This will solve the problem of users occasionally being confused by this behavior, which has happened even recently to coreutils developers. See for example:
> 
> http://lists.gnu.org/archive/html/coreutils/2015-03/msg00007.html

Your patch logic is confusing me.
I presume you mean to have `test --help` output usage by default?
If so I'm not sure it's appropriate to change that.
Consider a script like the following, which would spuriously output the version.

  option='--version'
  test "$option" || { usage; exit 1; }
  cmd $option

thanks,
Pádraig