Merge bitcoin/bitcoin#32049: contrib: Fix gen-bitcoin-conf.sh

a24419f8bed5e1145ce171dbbdad957750585471 contrib: Fix `gen-bitcoin-conf.sh`. (David Gumberg)

Pull request description:

  In #31118, the format of bitcoind's `--help` output changed slightly in a way that breaks `gen-bitcoin-conf.sh`, modify the script to accommodate the new format, by starting after the line that says "Options:" and stripping the `-help` options and descriptions from the script output.

  Before this PR, all options above `-help` were excluded from the example bitcoin.conf.

ACKs for top commit:
  mabu44:
    Tested ACK a24419f8bed5e1145ce171dbbdad957750585471
  glozow:
    ACK a24419f8bed5e1145ce171dbbdad957750585471
  rkrux:
    tACK a24419f8bed5e1145ce171dbbdad957750585471
  BrandonOdiwuor:
    crACK a24419f8bed5e1145ce171dbbdad957750585471

Tree-SHA512: 2ef697166d0b37b61ec1a20e357b91d611c932a0e453c4669f74ab69e6310ea1776dce09c1b77e82746072265763cb0c750e6df4c8b4a7d39068fc03f97b221b
This commit is contained in:
glozow 2025-03-13 16:58:38 -04:00
commit 5c2f04413e
No known key found for this signature in database
GPG Key ID: BA03F4DBE0C63FB4

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/' \