Changeset View
Changeset View
Standalone View
Standalone View
doc/man/gen-manpages.sh
Show All 37 Lines | |||||
then | then | ||||
echo "${BIN} not found or not executable." | echo "${BIN} not found or not executable." | ||||
exit 5 | exit 5 | ||||
fi | fi | ||||
mkdir -p "$(dirname ${MANPAGE})" | mkdir -p "$(dirname ${MANPAGE})" | ||||
# The autodetected version git tag can screw up manpage output a little bit | # The autodetected version git tag can screw up manpage output a little bit | ||||
read -r -a VERSION <<< "$(${BITCOIND} --version | head -n1 | awk -F'[ -]' '{ print $5, $6 }')" | read -r -a VERSION <<< "$(${BITCOIND} --version | awk -F'[ -]' 'NR == 1 { print $4, $5 }')" | ||||
# Create a footer file with copyright content. | # Create a footer file with copyright content. | ||||
# This gets autodetected fine for bitcoind if --version-string is not set, | # This gets autodetected fine for bitcoind if --version-string is not set, | ||||
# but has different outcomes for bitcoin-qt and bitcoin-cli. | # but has different outcomes for bitcoin-qt and bitcoin-cli. | ||||
FOOTER="$(basename ${BIN})_footer.h2m" | FOOTER="$(basename ${BIN})_footer.h2m" | ||||
cleanup() { | cleanup() { | ||||
rm -f "${FOOTER}" | rm -f "${FOOTER}" | ||||
} | } | ||||
trap "cleanup" EXIT | trap "cleanup" EXIT | ||||
echo "[COPYRIGHT]" > "${FOOTER}" | echo "[COPYRIGHT]" > "${FOOTER}" | ||||
"${BITCOIND}" --version | sed -n '1!p' >> "${FOOTER}" | "${BITCOIND}" --version | sed -n '1!p' >> "${FOOTER}" | ||||
help2man -N --version-string="${VERSION[0]}" --include="${FOOTER}" -o "${MANPAGE}" "${BIN}" | help2man -N --version-string="${VERSION[0]}" --include="${FOOTER}" -o "${MANPAGE}" "${BIN}" | ||||
sed -i "s/\\\-${VERSION[1]}//g" "${MANPAGE}" | sed -i "s/\\\-${VERSION[1]}//g" "${MANPAGE}" |