Skip to content

Commit cbe5050

Browse files
committed
generate-man.sh: try rst2man.py as well
1 parent 1d62116 commit cbe5050

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

generate-man.sh

+14-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,17 @@ if [ "$#" -ne 2 ]; then
55
exit 2
66
fi
77

8-
sed 's/^\.\. :X-man-page-only: \?//' -- "$1" | rst2man > "$2"
8+
has() {
9+
command -v "$1" >/dev/null
10+
}
11+
12+
if has rst2man; then
13+
RST2MAN=rst2man
14+
elif has rst2man.py; then
15+
RST2MAN=rst2man.py
16+
else
17+
echo >&2 "ERROR: neither 'rst2man' nor 'rst2man.py' were found."
18+
exit 1
19+
fi
20+
21+
sed 's/^\.\. :X-man-page-only: \?//' -- "$1" | $RST2MAN > "$2"

0 commit comments

Comments
 (0)