From: Mischa POSLAWSKY Date: Sat, 13 Mar 2021 06:03:13 +0000 (+0100) Subject: strip pipe arguments from test options X-Git-Tag: v1.08~21 X-Git-Url: http://git.shiar.nl/barcat.git/commitdiff_plain/beb81e63d94ed634661c385bf676ceb3544f9079 strip pipe arguments from test options Allow combination of -value and |command (or ?status) suffixes, without the latter part being duplicated. --- diff --git a/t/regress.t b/t/regress.t index cd8bb5e..508d361 100755 --- a/t/regress.t +++ b/t/regress.t @@ -35,7 +35,12 @@ do set -- barcat [ -r "$input" ] && set -- "$@" "$input" - case "$name" in *\ -*) set -- "$@" -"${name#* -}";; esac + case "$name" in + *\ -*) + args="${name#* -}" + set -- "$@" -"${args% [?|]*}" + ;; + esac case "$name" in *' ?' ) set -- sh -c "\$0 \$@ 2>/dev/null" "$@";; *' ?'*) set -- sh -c "\$0 \$@ | test \$\? = ${name#* \?}" "$@";;