This allows callers to more easily differentiate valid output from
errors. A recent example is facter. When calling virt-what for its
virtual fact, it gets 'virt-what: this script must be run as root' as
the fact value when run as non-root:
$ facter | grep ^virtual
virtual => virt-what: this script must be run as root
This is mildly related to RHBZ #719611¹.
¹ https://bugzilla.redhat.com/show_bug.cgi?id=719611
(cherry picked from commit
2f47e0615dab2bb16c2ad1e9f1273b3b709aea54)
VERSION="@VERSION@"
function fail {
- echo "virt-what: $1"
+ echo "virt-what: $1" >&2
exit 1
}