tests: convert the multi-prog $VERBOSE/--version uses
commit8f9be76b0d6995919ee960ce5864715faa11ea5b
authorJim Meyering <meyering@redhat.com>
Wed, 17 Nov 2010 20:38:38 +0000 (17 21:38 +0100)
committerJim Meyering <meyering@redhat.com>
Wed, 17 Nov 2010 20:46:25 +0000 (17 21:46 +0100)
tree94121a4b9c057ba2899e8a30e03a6e73510da716
parenta8c8484ee17f09ac92a27308b6ee5eaf4304bddc
tests: convert the multi-prog $VERBOSE/--version uses

E.g.,

-test "$VERBOSE" = yes && { env -- pwd --version; readlink --version; }
+print_ver_ pwd readlink

-test "$VERBOSE" = yes && { stdbuf --version; mv --version; }
+print_ver_ stdbuf mv

Use this command:
git grep -l 'VERBOSE.*--version'|xargs perl -ni \
  -e '/^test "\$VERBOSE" = yes && { .*--version/ or print,next;' \
  -e 's/env -- //g;' \
  -e 's/test "\$VERBOSE" = yes && { /print_ver_ /;' \
  -e ' s/(\w+) --version;/$1/g; s/ *}$//; print'
17 files changed:
tests/chmod/silent
tests/cp/acl
tests/cp/cp-mv-enotsup-xattr
tests/cp/perm
tests/ls/rt-1
tests/misc/env-null
tests/misc/pwd-unreadable-parent
tests/misc/stdbuf
tests/misc/xattr
tests/mkdir/selinux
tests/mv/acl
tests/mv/childproof
tests/mv/dup-source
tests/mv/hard-2
tests/mv/i-2
tests/mv/part-symlink
tests/mv/update