From 996de0a3e6901219a84e7c1a20636835daf606a4 Mon Sep 17 00:00:00 2001 From: David Steele Date: Wed, 16 Dec 2020 11:33:51 -0500 Subject: [PATCH] Remove cfgCmdNone from CFG_COMMAND_TOTAL. cfgCmdNone is used to indicate a missing or invalid command so should not be used in the total used for command process. --- build/lib/pgBackRestBuild/Config/Build.pm | 1 - src/command/help/help.c | 4 ++-- src/config/config.auto.h | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/build/lib/pgBackRestBuild/Config/Build.pm b/build/lib/pgBackRestBuild/Config/Build.pm index aa7f59bfb..2025310e9 100644 --- a/build/lib/pgBackRestBuild/Config/Build.pm +++ b/build/lib/pgBackRestBuild/Config/Build.pm @@ -207,7 +207,6 @@ sub buildConfig # Add "none" command that is used to initialize the current command before anything is parsed push(@{$rhEnum->{&BLD_LIST}}, buildConfigCommandEnum('none')); - $iCommandTotal++; $strBuildSource .= ")\n"; diff --git a/src/command/help/help.c b/src/command/help/help.c index 09815ee8e..2d2d135c6 100644 --- a/src/command/help/help.c +++ b/src/command/help/help.c @@ -169,7 +169,7 @@ helpRender(void) for (ConfigCommand commandId = 0; commandId < CFG_COMMAND_TOTAL; commandId++) { - if (commandId == cfgCmdNone || cfgCommandInternal(commandId)) + if (cfgCommandInternal(commandId)) continue; if (strlen(cfgCommandName(commandId)) > commandSizeMax) @@ -179,7 +179,7 @@ helpRender(void) // Output help for each command for (ConfigCommand commandId = 0; commandId < CFG_COMMAND_TOTAL; commandId++) { - if (commandId == cfgCmdNone || cfgCommandInternal(commandId)) + if (cfgCommandInternal(commandId)) continue; strCatFmt( diff --git a/src/config/config.auto.h b/src/config/config.auto.h index f552516b4..1747854a4 100644 --- a/src/config/config.auto.h +++ b/src/config/config.auto.h @@ -50,7 +50,7 @@ Command constants #define CFGCMD_VERSION "version" STRING_DECLARE(CFGCMD_VERSION_STR); -#define CFG_COMMAND_TOTAL 21 +#define CFG_COMMAND_TOTAL 20 /*********************************************************************************************************************************** Option group constants