aboutsummaryrefslogtreecommitdiff
path: root/aux/workflow/assert-manpages.sh
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-07-14 12:55:38 -0300
committerEuAndreh <eu@euandre.org>2021-07-14 12:55:38 -0300
commit92aa59b4481bfd30b9c29d3171c346e50fa93c9f (patch)
tree00582fcfe3ccee294f76cd3be7a0f237c00155ea /aux/workflow/assert-manpages.sh
parentTODOs.md: Mark #task-f65531fa-e44b-14b1-fa32-70a22346e060 as CANCELLED (diff)
downloadgit-permalink-92aa59b4481bfd30b9c29d3171c346e50fa93c9f.tar.gz
git-permalink-92aa59b4481bfd30b9c29d3171c346e50fa93c9f.tar.xz
aux/workflow/assert-manpages.sh: Exit with error for unknown language
Diffstat (limited to '')
-rwxr-xr-xaux/workflow/assert-manpages.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/aux/workflow/assert-manpages.sh b/aux/workflow/assert-manpages.sh
index d609685..be9c23d 100755
--- a/aux/workflow/assert-manpages.sh
+++ b/aux/workflow/assert-manpages.sh
@@ -179,6 +179,13 @@ Komentoj kaj diskutoj
EOF
+#
+# This assumes that the naming convention of the manpage files is:
+# a-name.$lang.[0-9]
+#
+# Having extra periods in the middle or at the end would violate this
+# assumption, and the code below won't work.
+#
# shellcheck disable=2044
for f in $(find doc -type f -name '*.[0-9]'); do
LINES="$(wc -l "$f" | cut -d\ -f1)"
@@ -192,6 +199,9 @@ for f in $(find doc -type f -name '*.[0-9]'); do
lang="$(echo "$f" | cut -d. -f2)"
case "$lang" in
+ en)
+ EXPECTED="$EXPECTED_EN"
+ ;;
pt)
EXPECTED="$EXPECTED_PT"
;;
@@ -202,7 +212,8 @@ for f in $(find doc -type f -name '*.[0-9]'); do
EXPECTED="$EXPECTED_EO"
;;
*)
- EXPECTED="$EXPECTED_EN"
+ printf 'Unsupported lang: %s\n' "$lang" >&2
+ exit 2
;;
esac