Skip to content

Commit fbda569

Browse files
committed
PGPRO-692: Improve help for archive-push/archive-get
1 parent 7b0d214 commit fbda569

File tree

2 files changed

+56
-7
lines changed

2 files changed

+56
-7
lines changed

src/archive.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ do_archive_push(char *wal_file_path, char *wal_file_name)
3131
pgBackupConfig *config;
3232

3333
if (wal_file_name == NULL && wal_file_path == NULL)
34-
elog(ERROR, "required parameters are not specified: --wal_file_name %%f --wal_file_path %%p");
34+
elog(ERROR, "required parameters are not specified: --wal-file-name %%f --wal-file-path %%p");
3535

3636
if (wal_file_name == NULL)
37-
elog(ERROR, "required parameter not specified: --wal_file_name %%f");
37+
elog(ERROR, "required parameter not specified: --wal-file-name %%f");
3838

3939
if (wal_file_path == NULL)
40-
elog(ERROR, "required parameter not specified: --wal_file_path %%p");
40+
elog(ERROR, "required parameter not specified: --wal-file-path %%p");
4141

4242
if (!getcwd(current_dir, sizeof(current_dir)))
4343
elog(ERROR, "getcwd() error");
@@ -83,13 +83,13 @@ do_archive_get(char *wal_file_path, char *wal_file_name)
8383
char current_dir[MAXPGPATH];
8484

8585
if (wal_file_name == NULL && wal_file_path == NULL)
86-
elog(ERROR, "required parameters are not specified: --wal_file_name %%f --wal_file_path %%p");
86+
elog(ERROR, "required parameters are not specified: --wal-file-name %%f --wal-file-path %%p");
8787

8888
if (wal_file_name == NULL)
89-
elog(ERROR, "required parameter not specified: --wal_file_name %%f");
89+
elog(ERROR, "required parameter not specified: --wal-file-name %%f");
9090

9191
if (wal_file_path == NULL)
92-
elog(ERROR, "required parameter not specified: --wal_file_path %%p");
92+
elog(ERROR, "required parameter not specified: --wal-file-path %%p");
9393

9494
if (!getcwd(current_dir, sizeof(current_dir)))
9595
elog(ERROR, "getcwd() error");

src/help.c

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ static void help_set_config(void);
1818
static void help_show_config(void);
1919
static void help_add_instance(void);
2020
static void help_del_instance(void);
21+
static void help_archive_push(void);
22+
static void help_archive_get(void);
2123

2224
void
2325
help_command(char *command)
@@ -42,6 +44,10 @@ help_command(char *command)
4244
help_add_instance();
4345
else if (strcmp(command, "del-instance") == 0)
4446
help_del_instance();
47+
else if (strcmp(command, "archive-push") == 0)
48+
help_archive_push();
49+
else if (strcmp(command, "archive-get") == 0)
50+
help_archive_get();
4551
else if (strcmp(command, "--help") == 0
4652
|| strcmp(command, "help") == 0
4753
|| strcmp(command, "-?") == 0
@@ -117,6 +123,15 @@ help_pg_probackup(void)
117123
printf(_("\n %s del-instance -B backup-dir\n"), PROGRAM_NAME);
118124
printf(_(" --instance=instance_name\n"));
119125

126+
printf(_("\n %s archive-push -B backup-dir --instance=instance_name\n"), PROGRAM_NAME);
127+
printf(_(" --wal-file-path=wal-file-path\n"));
128+
printf(_(" --wal-file-name=wal-file-name\n"));
129+
printf(_(" [--compress [--compress-level=compress-level]]\n"));
130+
131+
printf(_("\n %s archive-get -B backup-dir --instance=instance_name\n"), PROGRAM_NAME);
132+
printf(_(" --wal-file-path=wal-file-path\n"));
133+
printf(_(" --wal-file-name=wal-file-name\n"));
134+
120135
if ((PROGRAM_URL || PROGRAM_EMAIL))
121136
{
122137
printf("\n");
@@ -308,7 +323,7 @@ help_set_config(void)
308323
printf(_("\n Replica options:\n"));
309324
printf(_(" --master-db=db_name database to connect to master\n"));
310325
printf(_(" --master-host=host_name database server host of master\n"));
311-
printf(_(" --master-port=port=port database server port of master\n"));
326+
printf(_(" --master-port=port database server port of master\n"));
312327
printf(_(" --master-user=user_name user name to connect to master\n"));
313328
printf(_(" --replica-timeout=timeout wait timeout for WAL segment streaming through replication\n"));
314329
}
@@ -342,3 +357,37 @@ help_del_instance(void)
342357
printf(_(" -B, --backup-path=backup-path location of the backup storage area\n"));
343358
printf(_(" --instance=instance_name name of the instance to delete\n"));
344359
}
360+
361+
static void
362+
help_archive_push(void)
363+
{
364+
printf(_("\n %s archive-push -B backup-dir --instance=instance_name\n"), PROGRAM_NAME);
365+
printf(_(" --wal-file-path=wal-file-path\n"));
366+
printf(_(" --wal-file-name=wal-file-name\n"));
367+
printf(_(" [--compress [--compress-level=compress-level]]\n\n"));
368+
369+
printf(_(" -B, --backup-path=backup-path location of the backup storage area\n"));
370+
printf(_(" --instance=instance_name name of the instance to delete\n"));
371+
printf(_(" --wal-file-path=wal-file-path\n"));
372+
printf(_(" relative path name of the WAL file on the server\n"));
373+
printf(_(" --wal-file-name=wal-file-name\n"));
374+
printf(_(" name of the WAL file to retrieve from the server\n"));
375+
printf(_(" --compress compress WAL file during archiving\n"));
376+
printf(_(" --compress-level=compress-level\n"));
377+
printf(_(" level of compression [0-9]\n"));
378+
}
379+
380+
static void
381+
help_archive_get(void)
382+
{
383+
printf(_("\n %s archive-get -B backup-dir --instance=instance_name\n"), PROGRAM_NAME);
384+
printf(_(" --wal-file-path=wal-file-path\n"));
385+
printf(_(" --wal-file-name=wal-file-name\n\n"));
386+
387+
printf(_(" -B, --backup-path=backup-path location of the backup storage area\n"));
388+
printf(_(" --instance=instance_name name of the instance to delete\n"));
389+
printf(_(" --wal-file-path=wal-file-path\n"));
390+
printf(_(" relative destination path name of the WAL file on the server\n"));
391+
printf(_(" --wal-file-name=wal-file-name\n"));
392+
printf(_(" name of the WAL file to retrieve from the archive\n"));
393+
}

0 commit comments

Comments
 (0)