From 59cee7043a9bd79793bc2408e03df9501e2daa47 Mon Sep 17 00:00:00 2001 From: Brandon Odiwuor Date: Tue, 12 Nov 2024 10:46:26 +0300 Subject: [PATCH] doc: allow missing components when genrating manapages --- contrib/devtools/gen-manpages.py | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/contrib/devtools/gen-manpages.py b/contrib/devtools/gen-manpages.py index d30149a6ab129..515304914d4b0 100755 --- a/contrib/devtools/gen-manpages.py +++ b/contrib/devtools/gen-manpages.py @@ -7,6 +7,7 @@ import sys import tempfile import configparser +import argparse BINARIES = [ 'build/src/bitcoind', @@ -17,6 +18,14 @@ 'build/src/qt/bitcoin-qt', ] +parser = argparse.ArgumentParser() +parser.add_argument( + '--allow-missing-components', + action='store_true', + help='Allow missing components when generating manpages', +) +args = parser.parse_args() + # Paths to external utilities. git = os.getenv('GIT', 'git') help2man = os.getenv('HELP2MAN', 'help2man') @@ -81,14 +90,15 @@ 'ENABLE_USDT_TRACEPOINTS': 'USDT tracepoints', } -for component, description in (required_components | enabled_components).items(): - if not config['components'].getboolean(component, fallback=False): - print( - "Aborting generating manpages...\n" - f"Error: '{component}' ({description}) support is not enabled.\n" - "Please enable it and try again." - ) - sys.exit(1) +if not args.allow_missing_components: + for component, description in (required_components | enabled_components).items(): + if not config['components'].getboolean(component, fallback=False): + print( + "Aborting generating manpages...\n" + f"Error: '{component}' ({description}) support is not enabled.\n" + "Please enable it and try again." + ) + sys.exit(1) for component in config['components']: if component.upper() not in required_components and component.upper() not in enabled_components: