]> git.ipfire.org Git - thirdparty/systemd.git/blame - tools/meson-check-help.sh
final v236 update (#7649)
[thirdparty/systemd.git] / tools / meson-check-help.sh
CommitLineData
86b3ca7a 1#!/bin/sh -eu
005a29f2 2
07b3a026
YW
3export SYSTEMD_LOG_LEVEL=info
4
005a29f2
ZJS
5# output width
6if "$1" --help | grep -v 'default:' | grep -E -q '.{80}.'; then
b884196c
ZJS
7 echo "$(basename "$1") --help output is too wide:"
8 "$1" --help | awk 'length > 80' | grep -E --color=yes '.{80}'
9 exit 1
005a29f2
ZJS
10fi
11
12# no --help output to stdout
13if "$1" --help 2>&1 1>/dev/null | grep .; then
b884196c
ZJS
14 echo "$(basename "$1") --help prints to stderr"
15 exit 2
005a29f2
ZJS
16fi
17
18# error output to stderr
19if ! "$1" --no-such-parameter 2>&1 1>/dev/null | grep -q .; then
b884196c
ZJS
20 echo "$(basename "$1") with an unknown parameter does not print to stderr"
21 exit 3
005a29f2 22fi