You've already forked pg_probackup
mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-07-16 07:14:15 +02:00
Command changes. set-config/show-config instead of config command
This commit is contained in:
@ -133,8 +133,10 @@ main(int argc, char *argv[])
|
|||||||
backup_subcmd = SHOW;
|
backup_subcmd = SHOW;
|
||||||
else if (strcmp(argv[1], "delete") == 0)
|
else if (strcmp(argv[1], "delete") == 0)
|
||||||
backup_subcmd = DELETE;
|
backup_subcmd = DELETE;
|
||||||
else if (strcmp(argv[1], "config") == 0)
|
else if (strcmp(argv[1], "set-config") == 0)
|
||||||
backup_subcmd = CONFIGURE;
|
backup_subcmd = SET_CONFIG;
|
||||||
|
else if (strcmp(argv[1], "show-config") == 0)
|
||||||
|
backup_subcmd = SHOW_CONFIG;
|
||||||
else if (strcmp(argv[1], "--help") == 0
|
else if (strcmp(argv[1], "--help") == 0
|
||||||
|| strcmp(argv[1], "help") == 0
|
|| strcmp(argv[1], "help") == 0
|
||||||
|| strcmp(argv[1], "-?") == 0)
|
|| strcmp(argv[1], "-?") == 0)
|
||||||
@ -170,7 +172,7 @@ main(int argc, char *argv[])
|
|||||||
elog(ERROR, "-B, --backup-path must be a path to directory");
|
elog(ERROR, "-B, --backup-path must be a path to directory");
|
||||||
|
|
||||||
/* Do not read options from file or env if we're going to set them */
|
/* Do not read options from file or env if we're going to set them */
|
||||||
if (backup_subcmd != CONFIGURE)
|
if (backup_subcmd != SET_CONFIG)
|
||||||
{
|
{
|
||||||
/* Read options from configuration file */
|
/* Read options from configuration file */
|
||||||
join_path_components(path, backup_path, BACKUP_CATALOG_CONF_FILE);
|
join_path_components(path, backup_path, BACKUP_CATALOG_CONF_FILE);
|
||||||
@ -248,12 +250,14 @@ main(int argc, char *argv[])
|
|||||||
return do_retention_purge();
|
return do_retention_purge();
|
||||||
else
|
else
|
||||||
return do_delete(current.backup_id);
|
return do_delete(current.backup_id);
|
||||||
case CONFIGURE:
|
case SHOW_CONFIG:
|
||||||
/* TODO fixit */
|
if (argc > 4)
|
||||||
|
elog(ERROR, "show-config command doesn't accept any options");
|
||||||
|
return do_configure(true);
|
||||||
|
case SET_CONFIG:
|
||||||
if (argc == 4)
|
if (argc == 4)
|
||||||
return do_configure(true);
|
elog(ERROR, "set-config command requires at least one option");
|
||||||
else
|
return do_configure(false);
|
||||||
return do_configure(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -107,7 +107,8 @@ typedef enum ProbackupSubcmd
|
|||||||
VALIDATE,
|
VALIDATE,
|
||||||
SHOW,
|
SHOW,
|
||||||
DELETE,
|
DELETE,
|
||||||
CONFIGURE
|
SET_CONFIG,
|
||||||
|
SHOW_CONFIG
|
||||||
} ProbackupSubcmd;
|
} ProbackupSubcmd;
|
||||||
|
|
||||||
/* special values of pgBackup fields */
|
/* special values of pgBackup fields */
|
||||||
|
Reference in New Issue
Block a user