[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: true,false: --version,--help exit code
From: |
Pádraig Brady |
Subject: |
Re: true,false: --version,--help exit code |
Date: |
Tue, 03 Jun 2014 13:10:20 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 |
On 06/03/2014 12:28 PM, Bernhard Voelker wrote:
> On 06/03/2014 11:56 AM, Pádraig Brady wrote:
>> There is an inconsistency here with the (GNU) options.
>> Now I don't think anyone would ever be using `env true --version > blah`
>> in a script, but it would be better to be consistent here
>> and have the exit code dependent on the name rather than the environment.
>
> I don't have a strong preference whether to change true or false,
> but I'm fine with your choice.
>
>> I also see that the test script for `false` was only
>> checking the shell builtin :/
>
> Good catch!
>
>> The attached fixes up both issues in your name.
>
> Thanks!
> Should this be mentioned in NEWS, too?
Not worth it I think since not a practical issue.
>> OK to push?
>
> yes, sure, but ... wait, a test was failing; the following
> fixes it:
>
> diff --git a/gnulib b/gnulib
> index a10acfb..2f40bc5 160000
> --- a/gnulib
> +++ b/gnulib
> @@ -1 +1 @@
> -Subproject commit a10acfb1d2118f9a180181d3fed5399dbbe1df3c
> +Subproject commit 2f40bc523412742dac387b37d70b5a7f5d8363cc
> diff --git a/tests/misc/help-version.sh b/tests/misc/help-version.sh
> index 4bc02d8..50c05a2 100755
> --- a/tests/misc/help-version.sh
> +++ b/tests/misc/help-version.sh
> @@ -92,6 +92,13 @@ for lang in C fr da; do
>
> # Make sure they fail upon 'disk full' error.
> if test -w /dev/full && test -c /dev/full; then
> + # true succeeds with --help or --version even if write fails.
> + if test $i = true; then
> + env $i --help >/dev/full || fail=1
> + env $i --version >/dev/full || fail=1
The two lines above are already done in the separated test,
so we can just continue here. Also it's better to have
the continue and the special case for false(1) above this.
Also I see that the interations for LC_MESSAGES only for false
are redundant here. So I've cleaned up all that in the attached.
OK to push?
thanks,
Pádraig.
true-false.patch
Description: Text Data
- true,false: --version,--help exit code, Bernhard Voelker, 2014/06/03
- Re: true,false: --version,--help exit code, Pádraig Brady, 2014/06/03
- Re: true,false: --version,--help exit code, Bernhard Voelker, 2014/06/03
- Re: true,false: --version,--help exit code,
Pádraig Brady <=
- Re: true,false: --version,--help exit code, Eric Blake, 2014/06/03
- Re: true,false: --version,--help exit code, Pádraig Brady, 2014/06/03
- Re: true,false: --version,--help exit code, Jim Meyering, 2014/06/03
- Re: true,false: --version,--help exit code, Bernhard Voelker, 2014/06/03
- Re: true,false: --version,--help exit code, Jim Meyering, 2014/06/03
- Re: true,false: --version,--help exit code, Eric Blake, 2014/06/03
- Re: true,false: --version,--help exit code, Pádraig Brady, 2014/06/03
- Re: true,false: --version,--help exit code, Eric Blake, 2014/06/03
- Re: true,false: --version,--help exit code, Pádraig Brady, 2014/06/03
- Re: true,false: --version,--help exit code, Jim Meyering, 2014/06/03