coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: true,false: --version,--help exit code


From: Eric Blake
Subject: Re: true,false: --version,--help exit code
Date: Tue, 03 Jun 2014 08:44:32 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 06/03/2014 08:41 AM, Jim Meyering wrote:

>>
>> IMHO, there is no reason to ignore such a write error.
>> Hence, false --version and false --help (currently always failing) are the
>> ones I would change, so that they succeed when there is no write error.
> 
> On second thought, I don't like the idea of making false --help/--version
> exit successfully.
> 
> Maybe, gasp, we should just make true and false the exception from
> GNU's accept --help/--version philosophy, and simply exit 0/1, ignoring
> *all* options. This would add minor complication to true.1 and false.1
> man page generation, but it would not be hard to work around.

Another possibility - make it possible to detect write failure, by using
a non-default exit value:

true --help                    => 0
true --help > /dev/full        => 2
false --help                   => 1
false --help > /dev/full       => 2

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]