]> git.ipfire.org Git - thirdparty/systemd.git/blob - tools/meson-check-help.sh
meson: use "sh -eu" and make .sh +x, .py -x
[thirdparty/systemd.git] / tools / meson-check-help.sh
1 #!/bin/sh -eu
2
3 # output width
4 if "$1" --help | grep -v 'default:' | grep -E -q '.{80}.'; then
5 echo "$(basename "$1") --help output is too wide:"
6 "$1" --help | awk 'length > 80' | grep -E --color=yes '.{80}'
7 exit 1
8 fi
9
10 # no --help output to stdout
11 if "$1" --help 2>&1 1>/dev/null | grep .; then
12 echo "$(basename "$1") --help prints to stderr"
13 exit 2
14 fi
15
16 # error output to stderr
17 if ! "$1" --no-such-parameter 2>&1 1>/dev/null | grep -q .; then
18 echo "$(basename "$1") with an unknown parameter does not print to stderr"
19 exit 3
20 fi