]> git.ipfire.org Git - thirdparty/systemd.git/blame - tools/meson-check-help.sh
Merge pull request #6918 from ssahani/issue-5625
[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
b884196c
ZJS
5 echo "$(basename "$1") --help output is too wide:"
6 "$1" --help | awk 'length > 80' | grep -E --color=yes '.{80}'
7 exit 1
005a29f2
ZJS
8fi
9
10# no --help output to stdout
11if "$1" --help 2>&1 1>/dev/null | grep .; then
b884196c
ZJS
12 echo "$(basename "$1") --help prints to stderr"
13 exit 2
005a29f2
ZJS
14fi
15
16# error output to stderr
17if ! "$1" --no-such-parameter 2>&1 1>/dev/null | grep -q .; then
b884196c
ZJS
18 echo "$(basename "$1") with an unknown parameter does not print to stderr"
19 exit 3
005a29f2 20fi