From 5571c181b78f0f11ab5dc7ae761b19ee7c5f340f Mon Sep 17 00:00:00 2001 From: Johan Walles Date: Fri, 22 Jul 2022 11:26:04 +0200 Subject: [PATCH] Accept not having --version in the OPTIONS section It's documented separately at the top of the man page. --- test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test.sh b/test.sh index 6267322..3e7aeeb 100755 --- a/test.sh +++ b/test.sh @@ -52,9 +52,9 @@ echo Test --version... ./moar --version >/dev/null # Should exit with code 0 diff -u <(./moar --version) <(git describe --tags --dirty --always) -echo Verify man page and --help document the same set of options... +echo Test that the man page and --help document the same set of options... MAN_OPTIONS="$(grep -E '^\\fB' moar.1 | cut -d\\ -f4- | sed 's/fR.*//' | sed 's/\\//g')" -MOAR_OPTIONS="$(./moar --help | grep -E '^ -' | cut -d' ' -f3)" +MOAR_OPTIONS="$(./moar --help | grep -E '^ -' | cut -d' ' -f3 | grep -v -- -version)" diff -u <(echo "$MAN_OPTIONS") <(echo "$MOAR_OPTIONS") # FIXME: On unknown command line options, test that help text goes to stderr