]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
src/bin/duffman, scripts/bash_aliases: Move duffman() to a separate script
authorAlejandro Colomar <alx@kernel.org>
Thu, 9 Jan 2025 11:45:27 +0000 (12:45 +0100)
committerAlejandro Colomar <alx@kernel.org>
Fri, 10 Jan 2025 00:11:14 +0000 (01:11 +0100)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
scripts/bash_aliases
src/bin/duffman [new file with mode: 0755]

index 7576f67010addf6ed9088bab3ab3e28f4f9f5fdb..967a69efea5c33de19a3f76eca873c6af37cf681 100644 (file)
@@ -100,23 +100,3 @@ man_gitstaged()
        |tr -d '\n'                                                     \
        |sed 's/, $//';
 }
-
-# diff all modified pages against the system ones.
-
-duffman()
-{
-       cd $(git rev-parse --show-toplevel);
-
-       git diff --name-only \
-       | grep -E \
-          '(\.[[:digit:]]([[:alpha:]][[:alnum:]]*)?\>|\.man)+(\.man|\.in)*$' \
-       | sortman \
-       | while read f; do \
-               local sys="$(basename "$f")";
-
-               diffman "$@" "$sys" "$f";
-       done \
-       | less -R;
-
-       cd - >/dev/null;
-}
diff --git a/src/bin/duffman b/src/bin/duffman
new file mode 100755 (executable)
index 0000000..1fe47e5
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash
+#
+# Copyright 2024-2025, Alejandro Colomar <alx@kernel.org>
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+set -Eeuo pipefail;
+
+# diff all modified pages against the system ones.
+
+       cd $(git rev-parse --show-toplevel);
+
+       git diff --name-only \
+       | grep -E \
+          '(\.[[:digit:]]([[:alpha:]][[:alnum:]]*)?\>|\.man)+(\.man|\.in)*$' \
+       | sortman \
+       | while read f; do \
+               sys="$(basename "$f")";
+
+               diffman "$@" "$sys" "$f" || true;
+       done \
+       | less -R;