[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: true,false: --version,--help exit code
From: |
Bernhard Voelker |
Subject: |
Re: true,false: --version,--help exit code |
Date: |
Tue, 03 Jun 2014 13:28:22 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 |
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?
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
+ continue
+ fi
+
env $i --help >/dev/full 2>/dev/null && fail=1
env $i --version >/dev/full 2>/dev/null && fail=1
status=$?
Thanks & have a nice day,
Berny
- 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 <=
- 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
- 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