Skip to content

Commit 88754a7

Browse files
committed
update help output. TODO: implement detailed help for each command
1 parent 9c2730a commit 88754a7

File tree

2 files changed

+99
-60
lines changed

2 files changed

+99
-60
lines changed

pg_probackup.c

Lines changed: 80 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -267,47 +267,86 @@ main(int argc, char *argv[])
267267
void
268268
pgut_help(bool details)
269269
{
270-
printf(_("%s manage backup/recovery of PostgreSQL database.\n\n"), PROGRAM_NAME);
271-
printf(_("Usage:\n"));
272-
printf(_(" %s [option...] init\n"), PROGRAM_NAME);
273-
printf(_(" %s [option...] backup\n"), PROGRAM_NAME);
274-
printf(_(" %s [option...] restore [backup-ID]\n"), PROGRAM_NAME);
275-
printf(_(" %s [option...] show [backup-ID]\n"), PROGRAM_NAME);
276-
printf(_(" %s [option...] validate [backup-ID]\n"), PROGRAM_NAME);
277-
printf(_(" %s [option...] delete backup-ID\n"), PROGRAM_NAME);
278-
printf(_(" %s [option...] delwal [backup-ID]\n"), PROGRAM_NAME);
279-
printf(_(" %s [option...] retention show|purge\n"), PROGRAM_NAME);
280-
281-
if (!details)
282-
return;
283-
284-
printf(_("\nCommon Options:\n"));
285-
printf(_(" -B, --backup-path=PATH location of the backup storage area\n"));
286-
printf(_(" -D, --pgdata=PATH location of the database storage area\n"));
287-
/*printf(_(" -c, --check show what would have been done\n"));*/
288-
printf(_("\nBackup options:\n"));
289-
printf(_(" -b, --backup-mode=MODE backup mode (full, page, ptrack)\n"));
290-
printf(_(" -C, --smooth-checkpoint do smooth checkpoint before backup\n"));
291-
printf(_(" --stream stream the transaction log and include it in the backup\n"));
292-
printf(_(" --archive-timeout wait timeout for WAL segment archiving\n"));
293-
printf(_(" -S, --slot=SLOTNAME replication slot to use\n"));
294-
printf(_(" --backup-pg-log backup of pg_log directory\n"));
295-
printf(_(" -j, --threads=NUM number of parallel threads\n"));
296-
printf(_(" --progress show progress\n"));
297-
printf(_("\nRestore options:\n"));
298-
printf(_(" --time time stamp up to which recovery will proceed\n"));
299-
printf(_(" --xid transaction ID up to which recovery will proceed\n"));
300-
printf(_(" --inclusive whether we stop just after the recovery target\n"));
301-
printf(_(" --timeline recovering into a particular timeline\n"));
302-
printf(_(" -T, --tablespace-mapping=OLDDIR=NEWDIR\n"));
303-
printf(_(" relocate the tablespace in directory OLDDIR to NEWDIR\n"));
304-
printf(_(" -j, --threads=NUM number of parallel threads\n"));
305-
printf(_(" --progress show progress\n"));
306-
printf(_("\nDelete options:\n"));
307-
printf(_(" --wal remove unnecessary wal files\n"));
308-
printf(_("\nRetention options:\n"));
309-
printf(_(" --redundancy specifies how many full backups purge command should keep\n"));
310-
printf(_(" --window specifies the number of days of recoverability\n"));
270+
printf(_("\n%s - utility to manage backup/recovery of PostgreSQL database.\n\n"), PROGRAM_NAME);
271+
272+
printf(_(" %s help\n"), PROGRAM_NAME);
273+
274+
printf(_("\n %s version\n"), PROGRAM_NAME);
275+
276+
printf(_("\n %s init -B backup-path -D pgdata-dir\n"), PROGRAM_NAME);
277+
278+
printf(_("\n %s set-config -B backup-dir\n"), PROGRAM_NAME);
279+
printf(_(" [-d dbname] [-h host] [-p port] [-U username]\n"));
280+
printf(_(" [--retention-redundancy=retention-redundancy]]\n"));
281+
printf(_(" [--retention-window=retention-window]\n"));
282+
283+
printf(_("\n %s show-config -B backup-dir\n"), PROGRAM_NAME);
284+
285+
printf(_("\n %s backup -B backup-path -b backup-mode\n"), PROGRAM_NAME);
286+
printf(_(" [-D pgdata-dir] [-C] [--stream [-S slot-name]] [--backup-pg-log]\n"));
287+
printf(_(" [-j num-threads] [--archive-timeout=archive-timeout]\n"));
288+
printf(_(" [--progress] [-q] [-v] [--delete-expired]\n"));
289+
printf(_(" [-d dbname] [-h host] [-p port] [-U username]\n"));
290+
291+
printf(_("\n %s restore -B backup-dir\n"), PROGRAM_NAME);
292+
printf(_(" [-D pgdata-dir] [-i backup-id]\n"));
293+
printf(_(" [--time=time|--xid=xid [--inclusive=boolean]]\n"));
294+
printf(_(" [--timeline=timeline] [-T OLDDIR=NEWDIR]\n"));
295+
296+
printf(_("\n %s validate -B backup-dir\n"), PROGRAM_NAME);
297+
printf(_(" [-D pgdata-dir] [-i backup-id]\n"));
298+
printf(_(" [--time=time|--xid=xid [--inclusive=boolean]]\n"));
299+
printf(_(" [--timeline=timeline] [-T OLDDIR=NEWDIR]\n"));
300+
301+
printf(_("\n %s show -B backup-dir\n"), PROGRAM_NAME);
302+
printf(_(" [-i backup-id]\n"));
303+
304+
printf(_("\n %s delete -B backup-dir\n"), PROGRAM_NAME);
305+
printf(_(" [--wal] [-i backup-id | --expired] [--force]\n"));
306+
307+
308+
// printf(_(" -B, --backup-path=backup-path location of the backup storage area\n"));
309+
// printf(_(" -D, --pgdata=pgdata-dir location of the database storage area\n"));
310+
// printf(_(" -b, --backup-mode=backup-mode backup mode=FULL|PAGE|PTRACK\n"));
311+
// printf(" Connection options:\n");
312+
// printf(" -d, --dbname=DBNAME database to connect\n");
313+
// printf(" -h, --host=HOSTNAME database server host or socket directory\n");
314+
// printf(" -p, --port=PORT database server port\n");
315+
// printf(" -U, --username=USERNAME user name to connect as\n");
316+
// printf(" -w, --no-password never prompt for password\n");
317+
// printf(" -W, --password force password prompt\n");
318+
// printf(" Retention options:\n");
319+
// printf(_(" --retention-redundancy=n-full-backups specifies how many full backups purge command should keep\n"));
320+
// printf(_(" --retention-window=n-days specifies the number of days of recoverability\n"));
321+
//
322+
//
323+
// printf(_("\nOptional p:\n"));
324+
// printf(_(" -B, --backup-path=PATH location of the backup storage area\n"));
325+
// printf(_(" -D, --pgdata=PATH location of the database storage area\n"));
326+
// /*printf(_(" -c, --check show what would have been done\n"));*/
327+
// printf(_("\nBackup options:\n"));
328+
// printf(_(" -b, --backup-mode=MODE backup mode (full, page, ptrack)\n"));
329+
// printf(_(" -C, --smooth-checkpoint do smooth checkpoint before backup\n"));
330+
// printf(_(" --stream stream the transaction log and include it in the backup\n"));
331+
// printf(_(" --archive-timeout wait timeout for WAL segment archiving\n"));
332+
// printf(_(" -S, --slot=SLOTNAME replication slot to use\n"));
333+
// printf(_(" --backup-pg-log backup of pg_log directory\n"));
334+
// printf(_(" -j, --threads=NUM number of parallel threads\n"));
335+
// printf(_(" --progress show progress\n"));
336+
// printf(_("\nRestore options:\n"));
337+
// printf(_(" --time time stamp up to which recovery will proceed\n"));
338+
// printf(_(" --xid transaction ID up to which recovery will proceed\n"));
339+
// printf(_(" --inclusive whether we stop just after the recovery target\n"));
340+
// printf(_(" --timeline recovering into a particular timeline\n"));
341+
// printf(_(" -T, --tablespace-mapping=OLDDIR=NEWDIR\n"));
342+
// printf(_(" relocate the tablespace in directory OLDDIR to NEWDIR\n"));
343+
// printf(_(" -j, --threads=NUM number of parallel threads\n"));
344+
// printf(_(" --progress show progress\n"));
345+
// printf(_("\nDelete options:\n"));
346+
// printf(_(" --wal remove unnecessary wal files\n"));
347+
// printf(_("\nRetention options:\n"));
348+
// printf(_(" --redundancy specifies how many full backups purge command should keep\n"));
349+
// printf(_(" --window specifies the number of days of recoverability\n"));
311350
}
312351

313352
static void

pgut/pgut.c

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,25 +1291,25 @@ help(bool details)
12911291
{
12921292
pgut_help(details);
12931293

1294-
if (details)
1295-
{
1296-
printf("\nConnection options:\n");
1297-
printf(" -d, --dbname=DBNAME database to connect\n");
1298-
printf(" -h, --host=HOSTNAME database server host or socket directory\n");
1299-
printf(" -p, --port=PORT database server port\n");
1300-
printf(" -U, --username=USERNAME user name to connect as\n");
1301-
printf(" -w, --no-password never prompt for password\n");
1302-
printf(" -W, --password force password prompt\n");
1303-
}
1304-
1305-
printf("\nGeneric options:\n");
1306-
if (details)
1307-
{
1308-
printf(" -q, --quiet don't write any messages\n");
1309-
printf(" -v, --verbose verbose mode\n");
1310-
}
1311-
printf(" --help show this help, then exit\n");
1312-
printf(" --version output version information and exit\n");
1294+
// if (details)
1295+
// {
1296+
// printf("\nConnection options:\n");
1297+
// printf(" -d, --dbname=DBNAME database to connect\n");
1298+
// printf(" -h, --host=HOSTNAME database server host or socket directory\n");
1299+
// printf(" -p, --port=PORT database server port\n");
1300+
// printf(" -U, --username=USERNAME user name to connect as\n");
1301+
// printf(" -w, --no-password never prompt for password\n");
1302+
// printf(" -W, --password force password prompt\n");
1303+
// }
1304+
//
1305+
// printf("\nGeneric options:\n");
1306+
// if (details)
1307+
// {
1308+
// printf(" -q, --quiet don't write any messages\n");
1309+
// printf(" -v, --verbose verbose mode\n");
1310+
// }
1311+
// printf(" --help show this help, then exit\n");
1312+
// printf(" --version output version information and exit\n");
13131313

13141314
if (details && (PROGRAM_URL || PROGRAM_EMAIL))
13151315
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy