Signed-off-by: Alejandro Colomar <alx@kernel.org>
--- /dev/null
+.\" Copyright 2024, Alejandro Colomar <alx@kernel.org>
+.\"
+.\" SPDX-License-Identifier: Linux-man-pages-copyleft
+.\"
+.TH pdfman 1 (date) "Linux man-pages (unreleased)"
+.SH NAME
+pdfman
+\-
+render a manual page in PDF
+.SH SYNOPSIS
+.B pdfman
+.RI [ man-options ]
+.RI [ section ]\~ page
+.SH DESCRIPTION
+The
+.B pdfman
+command renders a manual page in PDF.
+All the arguments are interpreted by
+.BR man (1).
+.EE
+.SH SEE ALSO
+.BR man (1),
+.BR groff (1),
+.BR gropdf (1),
+.BR xdg\-open (1)
|uniq;
}
-# pdfman() renders a manual page in PDF
-# Usage example: .../man-pages$ pdfman man2/membarrier.2;
-
-pdfman()
-{
- local tmp="$(mktemp -t "${!###*/}.XXXXXX")";
-
- man -Tpdf "$@" >"$tmp";
- xdg-open "$tmp";
-}
-
# man_gitstaged prints a list of all files with changes staged for commit
# (basename only if the files are within <man?/>), separated by ", ".
# Usage example: .../man-pages$ git commit -m "$(man_gitstaged): msg";
--- /dev/null
+#!/bin/bash
+#
+# Copyright 2021-2024, Alejandro Colomar <alx@kernel.org>
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+set -Eeuo pipefail;
+
+tmp="$(mktemp -t "${!###*/}.XXXXXX")";
+
+man -Tpdf "$@" >"$tmp";
+xdg-open "$tmp";