GNU bug report logs - #20514
Patch to tie --help and --version behavior to POSIXLY_CORRECT

Previous Next

Package: coreutils;

Reported by: Shawn McMahon <syberghost <at> gmail.com>

Date: Wed, 6 May 2015 15:53:03 UTC

Severity: normal

Tags: wontfix

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 20514 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Shawn McMahon <syberghost <at> gmail.com>, 20514 <at> debbugs.gnu.org
Subject: Re: bug#20514: Patch to tie --help and --version behavior to
 POSIXLY_CORRECT
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




This bug report was last modified 10 years and 68 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.