t: filename shorthand '_?' to compare exit code
authorMischa POSLAWSKY <perl@shiar.org>
Fri, 4 Oct 2019 03:15:51 +0000 (05:15 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 8 Oct 2019 00:34:26 +0000 (02:34 +0200)
Make it easier to check for non-zero $? by replacing ' |[ $? = N ]' by ' ?N'
for same results with minimal clutter.

t/regress.t
t/t0003-invalid_options_-aZ_?64.out [moved from t/t0003-invalid_options_-aZ_|[_$?_=_64_].out with 100% similarity]

index 6a95a9f54e7bc08ec5a7d4d7ca590c4334f13ca9..5911e256e02b219f3bc6d4e483164d5c3cb9c514 100755 (executable)
@@ -37,6 +37,7 @@ do
        [ -r "$input" ] && set -- "$@" "$input"
        case "$name" in *\ -*) set -- "$@" -"${name#* -}";; esac
        case "$name" in
+               *' ?'*) set -- sh -c "\$0 \$1 | test \$\? = ${name#* \?}" "$@";;
                *' |'*) set -- sh -c "\$0 \$1 | ${name#* |}" "$@";;
                *)      set -- "$1" $2 $3
        esac