From f73c6382752ca8cad43a412a03b6b5f34cf94984 Mon Sep 17 00:00:00 2001 From: David Steele Date: Fri, 20 Sep 2024 15:21:38 +0300 Subject: [PATCH] Skip command-line options in configuration reference. Options that are only valid on the command-line should not appear in the configuration reference because it implies that they can be added to pgbackrest.conf, which is not the case. Most command-line options were already excluded because they lacked a section, but a few were slipping through. --- doc/src/command/build/reference.c | 5 +++++ test/src/module/doc/buildTest.c | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/src/command/build/reference.c b/doc/src/command/build/reference.c index 4e8c69fb6..8c0bcbb88 100644 --- a/doc/src/command/build/reference.c +++ b/doc/src/command/build/reference.c @@ -177,9 +177,14 @@ referenceConfigurationRender(const BldCfg *const bldCfg, const BldHlp *const bld const BldCfgOption *const optCfg = lstFind(bldCfg->optList, &optHlp->name); ASSERT(optCfg != NULL); + // Skip if option does not belong in this section if (!strEq(optHlp->section == NULL ? STRDEF("general") : optHlp->section, section->id)) continue; + // Skip if option is command-line only + if (strEq(optCfg->section, SECTION_COMMAND_LINE_STR)) + continue; + // Skip if option is internal if (optCfg->internal) continue; diff --git a/test/src/module/doc/buildTest.c b/test/src/module/doc/buildTest.c index 34ebfd5e9..83b43007f 100644 --- a/test/src/module/doc/buildTest.c +++ b/test/src/module/doc/buildTest.c @@ -258,11 +258,6 @@ testRun(void) "example: buffer-size=128KiB\n" "example: buffer-size=256KiB" "" - "
" - "Config Option (<id>--config</id>)" - "

config option summary.

" - "

config option description.

" - "
" "
" "Secure Option (<id>--secure</id>)" "

Secure option summary.

"