Skip to content

Commit d2cd9c0

Browse files
committed
add script to generate manpages with help2man
1 parent c072b8f commit d2cd9c0

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

contrib/devtools/gen-manpages.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
3+
# the autodetected version git tag at the end
4+
# can screw up manpage output a little bit
5+
BTCVER=$(bitcoin-cli --version | cut -d"-" -f1 | cut -d"v" -f3)
6+
7+
# Create a footer file with copyright content.
8+
# This gets autodetected fine for bitcoind if
9+
# --version-string is not set, but has different
10+
# outcomes for bitcoin-qt and bitcoin-cli.
11+
echo "[COPYRIGHT]" > footer.h2m
12+
bitcoind --version | sed -n '1!p' >> footer.h2m
13+
14+
for cmd in bitcoind bitcoin-qt bitcoin-cli; do
15+
help2man -N --version-string=${BTCVER} --include=footer.h2m -o ../../doc/man/${cmd}.1 ${cmd}
16+
done
17+
18+
rm -f footer.h2m

0 commit comments

Comments
 (0)