Skip to content

Commit 6c94ea7

Browse files
committed
Correct help texts.
1 parent 37da8b0 commit 6c94ea7

File tree

5 files changed

+50
-60
lines changed

5 files changed

+50
-60
lines changed

expected/option.out

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,37 @@
44
pg_probackup manage backup/recovery of PostgreSQL database.
55

66
Usage:
7-
pg_probackup OPTION init
8-
pg_probackup OPTION backup
9-
pg_probackup OPTION restore
10-
pg_probackup OPTION show [ID]
11-
pg_probackup OPTION validate [ID]
12-
pg_probackup OPTION delete ID
13-
pg_probackup OPTION delwal [ID]
7+
pg_probackup [option...] init
8+
pg_probackup [option...] backup
9+
pg_probackup [option...] restore
10+
pg_probackup [option...] show [backup-ID]
11+
pg_probackup [option...] validate [backup-ID]
12+
pg_probackup [option...] delete backup-ID
13+
pg_probackup [option...] delwal [backup-ID]
1414

1515
Common Options:
16-
-D, --pgdata=PATH location of the database storage area
1716
-B, --backup-path=PATH location of the backup storage area
18-
-j, --threads=NUM num threads for backup and restore
19-
--progress show progress copy files
17+
-D, --pgdata=PATH location of the database storage area
2018

2119
Backup options:
22-
-b, --backup-mode=MODE full,page,ptrack
20+
-b, --backup-mode=MODE backup mode (full, page, ptrack)
2321
-C, --smooth-checkpoint do smooth checkpoint before backup
24-
--stream use stream for save/restore WAL during backup
25-
--backup-pg-log start backup pg_log directory
22+
--stream stream the transaction log and include it in the backup
2623
-S, --slot=SLOTNAME replication slot to use
24+
--backup-pg-log backup of pg_log directory
25+
-j, --threads=NUM number of parallel threads
26+
--progress show progress
2727

2828
Restore options:
29-
--time time stamp up to which recovery will proceed
30-
--xid transaction ID up to which recovery will proceed
31-
--inclusive whether we stop just after the recovery target
32-
--timeline recovering into a particular timeline
33-
34-
Catalog options:
35-
-a, --show-all show deleted backup too
29+
--time time stamp up to which recovery will proceed
30+
--xid transaction ID up to which recovery will proceed
31+
--inclusive whether we stop just after the recovery target
32+
--timeline recovering into a particular timeline
33+
-j, --threads=NUM number of parallel threads
34+
--progress show progress
3635

3736
Delete options:
38-
--wal remove unnecessary wal archives also
37+
--wal remove unnecessary wal files
3938

4039
Connection options:
4140
-d, --dbname=DBNAME database to connect
@@ -48,8 +47,8 @@ Connection options:
4847
Generic options:
4948
-q, --quiet don't write any messages
5049
-v, --verbose verbose mode
51-
--help show this help, then exit
52-
--version output version information, then exit
50+
--help show this help, then exit
51+
--version output version information and exit
5352

5453
Read the website for details. <https://github.com/postgrespro/pg_probackup>
5554
Report bugs to <https://github.com/postgrespro/pg_probackup/issues>.

pg_probackup.c

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ static char *target_xid;
4747
static char *target_inclusive;
4848
static TimeLineID target_tli;
4949

50-
/* show configuration */
51-
static bool show_all = false;
52-
5350
static void opt_backup_mode(pgut_option *opt, const char *arg);
5451

5552
static pgut_option options[] =
@@ -75,8 +72,6 @@ static pgut_option options[] =
7572
{ 's', 4, "xid", &target_xid, SOURCE_ENV },
7673
{ 's', 5, "inclusive", &target_inclusive, SOURCE_ENV },
7774
{ 'u', 6, "timeline", &target_tli, SOURCE_ENV },
78-
/* catalog options */
79-
{ 'b', 'a', "show-all", &show_all },
8075
/* delete options */
8176
{ 'b', 12, "wal", &delete_wal },
8277
{ 0 }
@@ -205,7 +200,7 @@ main(int argc, char *argv[])
205200
return do_restore(backup_id, target_time, target_xid,
206201
target_inclusive, target_tli);
207202
else if (pg_strcasecmp(cmd, "show") == 0)
208-
return do_show(backup_id, show_all);
203+
return do_show(backup_id);
209204
else if (pg_strcasecmp(cmd, "validate") == 0)
210205
return do_validate(backup_id);
211206
else if (pg_strcasecmp(cmd, "delete") == 0)
@@ -223,40 +218,40 @@ pgut_help(bool details)
223218
{
224219
printf(_("%s manage backup/recovery of PostgreSQL database.\n\n"), PROGRAM_NAME);
225220
printf(_("Usage:\n"));
226-
printf(_(" %s OPTION init\n"), PROGRAM_NAME);
227-
printf(_(" %s OPTION backup\n"), PROGRAM_NAME);
228-
printf(_(" %s OPTION restore\n"), PROGRAM_NAME);
229-
printf(_(" %s OPTION show [ID]\n"), PROGRAM_NAME);
230-
printf(_(" %s OPTION validate [ID]\n"), PROGRAM_NAME);
231-
printf(_(" %s OPTION delete ID\n"), PROGRAM_NAME);
232-
printf(_(" %s OPTION delwal [ID]\n"), PROGRAM_NAME);
221+
printf(_(" %s [option...] init\n"), PROGRAM_NAME);
222+
printf(_(" %s [option...] backup\n"), PROGRAM_NAME);
223+
printf(_(" %s [option...] restore\n"), PROGRAM_NAME);
224+
printf(_(" %s [option...] show [backup-ID]\n"), PROGRAM_NAME);
225+
printf(_(" %s [option...] validate [backup-ID]\n"), PROGRAM_NAME);
226+
printf(_(" %s [option...] delete backup-ID\n"), PROGRAM_NAME);
227+
printf(_(" %s [option...] delwal [backup-ID]\n"), PROGRAM_NAME);
233228

234229
if (!details)
235230
return;
236231

237232
printf(_("\nCommon Options:\n"));
238-
printf(_(" -D, --pgdata=PATH location of the database storage area\n"));
239233
printf(_(" -B, --backup-path=PATH location of the backup storage area\n"));
234+
printf(_(" -D, --pgdata=PATH location of the database storage area\n"));
240235
/*printf(_(" -c, --check show what would have been done\n"));*/
241-
printf(_(" -j, --threads=NUM num threads for backup and restore\n"));
242-
printf(_(" --progress show progress copy files\n"));
243236
printf(_("\nBackup options:\n"));
244-
printf(_(" -b, --backup-mode=MODE full,page,ptrack\n"));
237+
printf(_(" -b, --backup-mode=MODE backup mode (full, page, ptrack)\n"));
245238
printf(_(" -C, --smooth-checkpoint do smooth checkpoint before backup\n"));
246-
printf(_(" --stream use stream for save/restore WAL during backup\n"));
239+
printf(_(" --stream stream the transaction log and include it in the backup\n"));
247240
/*printf(_(" --keep-data-generations=N keep GENERATION of full data backup\n"));
248241
printf(_(" --keep-data-days=DAY keep enough data backup to recover to DAY days age\n"));*/
249-
printf(_(" --backup-pg-log start backup pg_log directory\n"));
250242
printf(_(" -S, --slot=SLOTNAME replication slot to use\n"));
243+
printf(_(" --backup-pg-log backup of pg_log directory\n"));
244+
printf(_(" -j, --threads=NUM number of parallel threads\n"));
245+
printf(_(" --progress show progress\n"));
251246
printf(_("\nRestore options:\n"));
252-
printf(_(" --time time stamp up to which recovery will proceed\n"));
253-
printf(_(" --xid transaction ID up to which recovery will proceed\n"));
254-
printf(_(" --inclusive whether we stop just after the recovery target\n"));
255-
printf(_(" --timeline recovering into a particular timeline\n"));
256-
printf(_("\nCatalog options:\n"));
257-
printf(_(" -a, --show-all show deleted backup too\n"));
247+
printf(_(" --time time stamp up to which recovery will proceed\n"));
248+
printf(_(" --xid transaction ID up to which recovery will proceed\n"));
249+
printf(_(" --inclusive whether we stop just after the recovery target\n"));
250+
printf(_(" --timeline recovering into a particular timeline\n"));
251+
printf(_(" -j, --threads=NUM number of parallel threads\n"));
252+
printf(_(" --progress show progress\n"));
258253
printf(_("\nDelete options:\n"));
259-
printf(_(" --wal remove unnecessary wal archives also\n"));
254+
printf(_(" --wal remove unnecessary wal files\n"));
260255
}
261256

262257
static void

pg_probackup.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ extern int do_restore(time_t backup_id,
225225
extern int do_init(void);
226226

227227
/* in show.c */
228-
extern int do_show(time_t backup_id, bool show_all);
228+
extern int do_show(time_t backup_id);
229229

230230
/* in delete.c */
231231
extern int do_delete(time_t backup_id);

pgut/pgut.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,8 +1453,8 @@ help(bool details)
14531453
printf(" -q, --quiet don't write any messages\n");
14541454
printf(" -v, --verbose verbose mode\n");
14551455
}
1456-
printf(" --help show this help, then exit\n");
1457-
printf(" --version output version information, then exit\n");
1456+
printf(" --help show this help, then exit\n");
1457+
printf(" --version output version information and exit\n");
14581458

14591459
if (details && (PROGRAM_URL || PROGRAM_EMAIL))
14601460
{

show.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#include "pg_probackup.h"
1111

12-
static void show_backup_list(FILE *out, parray *backup_list, bool show_all);
12+
static void show_backup_list(FILE *out, parray *backup_list);
1313
static void show_backup_detail(FILE *out, pgBackup *backup);
1414

1515
/*
@@ -18,7 +18,7 @@ static void show_backup_detail(FILE *out, pgBackup *backup);
1818
* backup indicated by id.
1919
*/
2020
int
21-
do_show(time_t backup_id, bool show_all)
21+
do_show(time_t backup_id)
2222
{
2323
/*
2424
* Safety check for archive folder, this is necessary to fetch
@@ -52,7 +52,7 @@ do_show(time_t backup_id, bool show_all)
5252
if (backup_list == NULL)
5353
elog(ERROR, "can't process any more.");
5454

55-
show_backup_list(stdout, backup_list, show_all);
55+
show_backup_list(stdout, backup_list);
5656

5757
/* cleanup */
5858
parray_walk(backup_list, pgBackupFree);
@@ -160,7 +160,7 @@ get_parent_tli(TimeLineID child_tli)
160160
}
161161

162162
static void
163-
show_backup_list(FILE *out, parray *backup_list, bool show_all)
163+
show_backup_list(FILE *out, parray *backup_list)
164164
{
165165
int i;
166166

@@ -180,10 +180,6 @@ show_backup_list(FILE *out, parray *backup_list, bool show_all)
180180

181181
backup = parray_get(backup_list, i);
182182

183-
/* skip deleted backup */
184-
if (backup->status == BACKUP_STATUS_DELETED && !show_all)
185-
continue;
186-
187183
time2iso(timestamp, lengthof(timestamp), backup->recovery_time);
188184
if (backup->end_time != (time_t) 0)
189185
snprintf(duration, lengthof(duration), "%lum",

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