Merge #11597: [trivial] Fix error messages in CFeeBumper
[bitcoinplatinum.git] / contrib / devtools / gen-manpages.sh
blob967717e1e0d6d2a1f5f8bce7c72ba13fd324a9da
1 #!/bin/sh
3 TOPDIR=${TOPDIR:-$(git rev-parse --show-toplevel)}
4 SRCDIR=${SRCDIR:-$TOPDIR/src}
5 MANDIR=${MANDIR:-$TOPDIR/doc/man}
7 BITCOIND=${BITCOIND:-$SRCDIR/bitcoind}
8 BITCOINCLI=${BITCOINCLI:-$SRCDIR/bitcoin-cli}
9 BITCOINTX=${BITCOINTX:-$SRCDIR/bitcoin-tx}
10 BITCOINQT=${BITCOINQT:-$SRCDIR/qt/bitcoin-qt}
12 [ ! -x $BITCOIND ] && echo "$BITCOIND not found or not executable." && exit 1
14 # The autodetected version git tag can screw up manpage output a little bit
15 BTCVER=($($BITCOINCLI --version | head -n1 | awk -F'[ -]' '{ print $6, $7 }'))
17 # Create a footer file with copyright content.
18 # This gets autodetected fine for bitcoind if --version-string is not set,
19 # but has different outcomes for bitcoin-qt and bitcoin-cli.
20 echo "[COPYRIGHT]" > footer.h2m
21 $BITCOIND --version | sed -n '1!p' >> footer.h2m
23 for cmd in $BITCOIND $BITCOINCLI $BITCOINTX $BITCOINQT; do
24 cmdname="${cmd##*/}"
25 help2man -N --version-string=${BTCVER[0]} --include=footer.h2m -o ${MANDIR}/${cmdname}.1 ${cmd}
26 sed -i "s/\\\-${BTCVER[1]}//g" ${MANDIR}/${cmdname}.1
27 done
29 rm -f footer.h2m