1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-05 00:28:52 +02:00

Remove cfgOptionId() and replace it with cfgParseOption().

cfgOptionId() did not recognize deprecated options which made the help command throw errors when they were specified on the command line. cfgParseOption() will correctly identify deprecated options.

cfgParseOption() can also be used in cfgParse() to reduce code duplication when parsing info out of the option value returned by optionFind().

Finally, code the option key index separately in parse.auto.c. For now they are simply added back together but future code will need them separated.
This commit is contained in:
David Steele
2020-10-20 11:24:26 -04:00
parent 6414ae9707
commit 41789d70d1
11 changed files with 578 additions and 547 deletions

View File

@ -309,7 +309,7 @@ testRun(void)
// -------------------------------------------------------------------------------------------------------------------------
optionHelp = strZ(strNewFmt(
"%s - 'archive-push' command - 'repo1-s3-host' option help\n"
"%s - 'archive-push' command - 'repo-s3-host' option help\n"
"\n"
"S3 repository host.\n"
"\n"
@ -379,6 +379,15 @@ testRun(void)
harnessCfgLoadRaw(strLstSize(argList), strLstPtr(argList)), "help for backup command, repo-hardlink option");
TEST_RESULT_STR_Z(helpRender(), optionHelp, " check text");
argList = strLstNew();
strLstAddZ(argList, "/path/to/pgbackrest");
strLstAddZ(argList, "help");
strLstAddZ(argList, "backup");
strLstAddZ(argList, "hardlink");
TEST_RESULT_VOID(
harnessCfgLoadRaw(strLstSize(argList), strLstPtr(argList)), "help for backup command, deprecated hardlink option");
TEST_RESULT_STR_Z(helpRender(), optionHelp, " check text");
// Check admonition
// -------------------------------------------------------------------------------------------------------------------------
optionHelp = strZ(strNewFmt(