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

Make --repo optional for remaining commands except stanza-delete.

Some commands (repo-*, verify) still required the --repo option but it makes sense to give them the same treatment as backup and simply use the first repo when one is not specified.

This leaves stanza-delete as the only remaining command that requires --repo. This is by design to enhance safe usage.
This commit is contained in:
David Steele
2021-03-03 09:21:06 -05:00
parent cb26e8c72d
commit 95063f6812
4 changed files with 19 additions and 17 deletions

View File

@ -938,16 +938,9 @@ testRun(void)
if (testBegin("cmdVerify(), verifyProcess() - errors"))
{
//--------------------------------------------------------------------------------------------------------------------------
// Load Parameters with multi-repo
StringList *argList = strLstDup(argListBase);
hrnCfgArgKeyRawFmt(argList, cfgOptRepoPath, 4, "%s/repo4", testPath());
TEST_ERROR_FMT(
harnessCfgLoad(cfgCmdVerify, argList), OptionRequiredError, "verify command requires option: repo\n"
"HINT: this command requires a specific repository to operate on");
//--------------------------------------------------------------------------------------------------------------------------
// Load Parameters with multi-repo
hrnCfgArgRawZ(argList, cfgOptRepo, "1");
harnessCfgLoad(cfgCmdVerify, argList);
// Store valid archive/backup info files