contrib: Fix gen-bitcoin-conf.sh.

In #31118, the format of bitcoind's `--help` output changed slightly in
a way that breaks `gen-bitcoin-conf.sh`, modify the script to accomodate
the new format, by starting after the line that says "Options:" and
strip the `-help` option and its description from the output.
This commit is contained in:
David Gumberg 2025-03-12 14:55:14 -07:00
parent aa68ed27b8
commit a24419f8be

View File

@ -50,7 +50,8 @@ EOF
# adding newlines is a bit funky to ensure portability for BSD
# see here for more details: https://stackoverflow.com/a/24575385
${BITCOIND} --help \
| sed '1,/Print this help message and exit/d' \
| sed '1,/Options:/d' \
| sed -E '/^[[:space:]]{2}-help/,/^[[:space:]]*$/d' \
| sed -E 's/^[[:space:]]{2}\-/#/' \
| sed -E 's/^[[:space:]]{7}/# /' \
| sed -E '/[=[:space:]]/!s/#.*$/&=1/' \