]> git.ipfire.org Git - thirdparty/systemd.git/blame - tools/meson-check-help.sh
meson: use "sh -eu" and make .sh +x, .py -x
[thirdparty/systemd.git] / tools / meson-check-help.sh
CommitLineData
86b3ca7a 1#!/bin/sh -eu
005a29f2
ZJS
2
3# output width
4if "$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
8fi
9
10# no --help output to stdout
11if "$1" --help 2>&1 1>/dev/null | grep .; then
12 echo "$(basename "$1") --help prints to stderr"
13 exit 2
14fi
15
16# error output to stderr
17if ! "$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
20fi