Guest User

gen-manpages.sh

a guest
Aug 27th, 2016
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.88 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. SRCDIR=${SRCDIR:-../../src}
  4. MANDIR=${MANDIR:-../../doc/man}
  5.  
  6. BITCOIND=${BITCOIND:-$SRCDIR/bitcoind}
  7. BITCOINCLI=${BITCOINCLI:-$SRCDIR/bitcoin-cli}
  8. BITCOINQT=${BITCOINQT:-$SRCDIR/qt/bitcoin-qt}
  9.  
  10. [ ! -x $BITCOIND ] && echo "$BITCOIND not found or not executable." && exit 1
  11.  
  12. # the autodetected version git tag can screw up manpage output a little bit
  13. BTCVER=$($BITCOINCLI --version | cut -d"-" -f1 | cut -d"v" -f3)
  14.  
  15. # Create a footer file with copyright content.
  16. # This gets autodetected fine for bitcoind if --version-string is not set,
  17. # but has different outcomes for bitcoin-qt and bitcoin-cli.
  18. echo "[COPYRIGHT]" > footer.h2m
  19. $BITCOIND --version | sed -n '1!p' >> footer.h2m
  20.  
  21. for cmd in $BITCOIND $BITCOINCLI $BITCOINQT; do
  22.   cmdname="${cmd##*/}"
  23.   help2man -N --version-string=${BTCVER} --include=footer.h2m -o ${MANDIR}/${cmdname}.1 ${cmd}
  24. done
  25.  
  26. rm -f footer.h2m
Add Comment
Please, Sign In to add comment