From 3c1721d6c7db8bf4369afe25fd31409fd6fac338 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?=
Date: Fri, 14 Nov 2025 23:44:30 +0000
Subject: [PATCH] tests: verify we document all supported options in --help
* tests/misc/getopt_vs_usage.sh: A new test which checks the
converse of usage_vs_getopt.sh
* tests/local.mk: Reference the new test.
---
tests/local.mk | 1 +
tests/misc/getopt_vs_usage.sh | 59 +++++++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+)
create mode 100755 tests/misc/getopt_vs_usage.sh
diff --git a/tests/local.mk b/tests/local.mk
index fd484476a8..cab2dae74f 100644
--- a/tests/local.mk
+++ b/tests/local.mk
@@ -483,6 +483,7 @@ all_tests = \
tests/misc/tsort.pl \
tests/tty/tty.sh \
tests/misc/usage_vs_getopt.sh \
+ tests/misc/getopt_vs_usage.sh \
tests/misc/unexpand.pl \
tests/uniq/uniq.pl \
tests/uniq/uniq-perf.sh \
diff --git a/tests/misc/getopt_vs_usage.sh b/tests/misc/getopt_vs_usage.sh
new file mode 100755
index 0000000000..5fe943c312
--- /dev/null
+++ b/tests/misc/getopt_vs_usage.sh
@@ -0,0 +1,59 @@
+#!/bin/sh
+# Verify that all supported options are mentioned in usage
+
+# Copyright (C) 2025 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see