aboutsummaryrefslogtreecommitdiff
path: root/contrib/devtools
diff options
context:
space:
mode:
authornomnombtc <mastergizmo@arcor.de>2016-08-27 00:59:07 +0200
committernomnombtc <mastergizmo@arcor.de>2016-08-27 00:59:07 +0200
commitd2cd9c033b603cb25dc4516f3511afa52dfb1ce0 (patch)
tree2e8ecdf0826d4a42bec0b18ea8e0ac4a08506db7 /contrib/devtools
parentc072b8fd95cd4fa84f08189a0cd8b173ea2dbb8e (diff)
add script to generate manpages with help2man
Diffstat (limited to 'contrib/devtools')
-rwxr-xr-xcontrib/devtools/gen-manpages.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/contrib/devtools/gen-manpages.sh b/contrib/devtools/gen-manpages.sh
new file mode 100755
index 0000000000..7cd7d1b509
--- /dev/null
+++ b/contrib/devtools/gen-manpages.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# the autodetected version git tag at the end
+# can screw up manpage output a little bit
+BTCVER=$(bitcoin-cli --version | cut -d"-" -f1 | cut -d"v" -f3)
+
+# Create a footer file with copyright content.
+# This gets autodetected fine for bitcoind if
+# --version-string is not set, but has different
+# outcomes for bitcoin-qt and bitcoin-cli.
+echo "[COPYRIGHT]" > footer.h2m
+bitcoind --version | sed -n '1!p' >> footer.h2m
+
+for cmd in bitcoind bitcoin-qt bitcoin-cli; do
+ help2man -N --version-string=${BTCVER} --include=footer.h2m -o ../../doc/man/${cmd}.1 ${cmd}
+done
+
+rm -f footer.h2m