Commit bff074b1 authored by Peter Eisentraut's avatar Peter Eisentraut

Message style cleanup

parent ce2fc200
...@@ -118,23 +118,23 @@ xmalloc0(int size) ...@@ -118,23 +118,23 @@ xmalloc0(int size)
static void static void
usage(void) usage(void)
{ {
printf(_("%s takes base backups of running PostgreSQL servers\n\n"), printf(_("%s takes a base backup of a running PostgreSQL server.\n\n"),
progname); progname);
printf(_("Usage:\n")); printf(_("Usage:\n"));
printf(_(" %s [OPTION]...\n"), progname); printf(_(" %s [OPTION]...\n"), progname);
printf(_("\nOptions controlling the output:\n")); printf(_("\nOptions controlling the output:\n"));
printf(_(" -D, --pgdata=directory receive base backup into directory\n")); printf(_(" -D, --pgdata=DIRECTORY receive base backup into directory\n"));
printf(_(" -F, --format=p|t output format (plain, tar)\n")); printf(_(" -F, --format=p|t output format (plain, tar)\n"));
printf(_(" -x, --xlog include required WAL files in backup\n")); printf(_(" -x, --xlog include required WAL files in backup\n"));
printf(_(" -Z, --compress=0-9 compress tar output\n")); printf(_(" -Z, --compress=0-9 compress tar output\n"));
printf(_("\nGeneral options:\n")); printf(_("\nGeneral options:\n"));
printf(_(" -c, --checkpoint=fast|spread\n" printf(_(" -c, --checkpoint=fast|spread\n"
" set fast or spread checkpointing\n")); " set fast or spread checkpointing\n"));
printf(_(" -l, --label=label set backup label\n")); printf(_(" -l, --label=LABEL set backup label\n"));
printf(_(" -P, --progress show progress information\n")); printf(_(" -P, --progress show progress information\n"));
printf(_(" -v, --verbose output verbose messages\n")); printf(_(" -v, --verbose output verbose messages\n"));
printf(_(" -?, --help show this help, then exit\n")); printf(_(" --help show this help, then exit\n"));
printf(_(" -V, --version output version information, then exit\n")); printf(_(" --version output version information, then exit\n"));
printf(_("\nConnection options:\n")); printf(_("\nConnection options:\n"));
printf(_(" -h, --host=HOSTNAME database server host or socket directory\n")); printf(_(" -h, --host=HOSTNAME database server host or socket directory\n"));
printf(_(" -p, --port=PORT database server port number\n")); printf(_(" -p, --port=PORT database server port number\n"));
...@@ -337,7 +337,7 @@ ReceiveTarFile(PGconn *conn, PGresult *res, int rownum) ...@@ -337,7 +337,7 @@ ReceiveTarFile(PGconn *conn, PGresult *res, int rownum)
res = PQgetResult(conn); res = PQgetResult(conn);
if (PQresultStatus(res) != PGRES_COPY_OUT) if (PQresultStatus(res) != PGRES_COPY_OUT)
{ {
fprintf(stderr, _("%s: could not get COPY data stream: %s\n"), fprintf(stderr, _("%s: could not get COPY data stream: %s"),
progname, PQerrorMessage(conn)); progname, PQerrorMessage(conn));
disconnect_and_exit(1); disconnect_and_exit(1);
} }
...@@ -398,7 +398,7 @@ ReceiveTarFile(PGconn *conn, PGresult *res, int rownum) ...@@ -398,7 +398,7 @@ ReceiveTarFile(PGconn *conn, PGresult *res, int rownum)
} }
else if (r == -2) else if (r == -2)
{ {
fprintf(stderr, _("%s: could not read COPY data: %s\n"), fprintf(stderr, _("%s: could not read COPY data: %s"),
progname, PQerrorMessage(conn)); progname, PQerrorMessage(conn));
disconnect_and_exit(1); disconnect_and_exit(1);
} }
...@@ -467,7 +467,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum) ...@@ -467,7 +467,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum)
res = PQgetResult(conn); res = PQgetResult(conn);
if (PQresultStatus(res) != PGRES_COPY_OUT) if (PQresultStatus(res) != PGRES_COPY_OUT)
{ {
fprintf(stderr, _("%s: could not get COPY data stream: %s\n"), fprintf(stderr, _("%s: could not get COPY data stream: %s"),
progname, PQerrorMessage(conn)); progname, PQerrorMessage(conn));
disconnect_and_exit(1); disconnect_and_exit(1);
} }
...@@ -496,7 +496,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum) ...@@ -496,7 +496,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum)
} }
else if (r == -2) else if (r == -2)
{ {
fprintf(stderr, _("%s: could not read COPY data: %s\n"), fprintf(stderr, _("%s: could not read COPY data: %s"),
progname, PQerrorMessage(conn)); progname, PQerrorMessage(conn));
disconnect_and_exit(1); disconnect_and_exit(1);
} }
...@@ -510,7 +510,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum) ...@@ -510,7 +510,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum)
*/ */
if (r != 512) if (r != 512)
{ {
fprintf(stderr, _("%s: Invalid tar block header size: %i\n"), fprintf(stderr, _("%s: invalid tar block header size: %i\n"),
progname, r); progname, r);
disconnect_and_exit(1); disconnect_and_exit(1);
} }
...@@ -518,7 +518,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum) ...@@ -518,7 +518,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum)
if (sscanf(copybuf + 124, "%11o", &current_len_left) != 1) if (sscanf(copybuf + 124, "%11o", &current_len_left) != 1)
{ {
fprintf(stderr, _("%s: could not parse file size!\n"), fprintf(stderr, _("%s: could not parse file size\n"),
progname); progname);
disconnect_and_exit(1); disconnect_and_exit(1);
} }
...@@ -526,7 +526,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum) ...@@ -526,7 +526,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum)
/* Set permissions on the file */ /* Set permissions on the file */
if (sscanf(&copybuf[100], "%07o ", &filemode) != 1) if (sscanf(&copybuf[100], "%07o ", &filemode) != 1)
{ {
fprintf(stderr, _("%s: could not parse file mode!\n"), fprintf(stderr, _("%s: could not parse file mode\n"),
progname); progname);
disconnect_and_exit(1); disconnect_and_exit(1);
} }
...@@ -581,7 +581,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum) ...@@ -581,7 +581,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum)
} }
else else
{ {
fprintf(stderr, _("%s: unknown link indicator \"%c\"\n"), fprintf(stderr, _("%s: unrecognized link indicator \"%c\"\n"),
progname, copybuf[156]); progname, copybuf[156]);
disconnect_and_exit(1); disconnect_and_exit(1);
} }
...@@ -659,7 +659,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum) ...@@ -659,7 +659,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum)
if (file != NULL) if (file != NULL)
{ {
fprintf(stderr, _("%s: last file was never finished!\n"), progname); fprintf(stderr, _("%s: last file was never finished\n"), progname);
disconnect_and_exit(1); disconnect_and_exit(1);
} }
...@@ -740,7 +740,7 @@ GetConnection(void) ...@@ -740,7 +740,7 @@ GetConnection(void)
if (PQstatus(tmpconn) != CONNECTION_OK) if (PQstatus(tmpconn) != CONNECTION_OK)
{ {
fprintf(stderr, _("%s: could not connect to server: %s\n"), fprintf(stderr, _("%s: could not connect to server: %s"),
progname, PQerrorMessage(tmpconn)); progname, PQerrorMessage(tmpconn));
exit(1); exit(1);
} }
...@@ -780,7 +780,7 @@ BaseBackup(void) ...@@ -780,7 +780,7 @@ BaseBackup(void)
if (PQsendQuery(conn, current_path) == 0) if (PQsendQuery(conn, current_path) == 0)
{ {
fprintf(stderr, _("%s: could not start base backup: %s\n"), fprintf(stderr, _("%s: could not start base backup: %s"),
progname, PQerrorMessage(conn)); progname, PQerrorMessage(conn));
disconnect_and_exit(1); disconnect_and_exit(1);
} }
...@@ -791,13 +791,13 @@ BaseBackup(void) ...@@ -791,13 +791,13 @@ BaseBackup(void)
res = PQgetResult(conn); res = PQgetResult(conn);
if (PQresultStatus(res) != PGRES_TUPLES_OK) if (PQresultStatus(res) != PGRES_TUPLES_OK)
{ {
fprintf(stderr, _("%s: could not initiate base backup: %s\n"), fprintf(stderr, _("%s: could not initiate base backup: %s"),
progname, PQerrorMessage(conn)); progname, PQerrorMessage(conn));
disconnect_and_exit(1); disconnect_and_exit(1);
} }
if (PQntuples(res) != 1) if (PQntuples(res) != 1)
{ {
fprintf(stderr, _("%s: no start point returned from server.\n"), fprintf(stderr, _("%s: no start point returned from server\n"),
progname); progname);
disconnect_and_exit(1); disconnect_and_exit(1);
} }
...@@ -813,13 +813,13 @@ BaseBackup(void) ...@@ -813,13 +813,13 @@ BaseBackup(void)
res = PQgetResult(conn); res = PQgetResult(conn);
if (PQresultStatus(res) != PGRES_TUPLES_OK) if (PQresultStatus(res) != PGRES_TUPLES_OK)
{ {
fprintf(stderr, _("%s: could not get backup header: %s\n"), fprintf(stderr, _("%s: could not get backup header: %s"),
progname, PQerrorMessage(conn)); progname, PQerrorMessage(conn));
disconnect_and_exit(1); disconnect_and_exit(1);
} }
if (PQntuples(res) < 1) if (PQntuples(res) < 1)
{ {
fprintf(stderr, _("%s: no data returned from server.\n"), progname); fprintf(stderr, _("%s: no data returned from server\n"), progname);
disconnect_and_exit(1); disconnect_and_exit(1);
} }
...@@ -847,7 +847,7 @@ BaseBackup(void) ...@@ -847,7 +847,7 @@ BaseBackup(void)
*/ */
if (format == 't' && strcmp(basedir, "-") == 0 && PQntuples(res) > 1) if (format == 't' && strcmp(basedir, "-") == 0 && PQntuples(res) > 1)
{ {
fprintf(stderr, _("%s: can only write single tablespace to stdout, database has %i.\n"), fprintf(stderr, _("%s: can only write single tablespace to stdout, database has %i\n"),
progname, PQntuples(res)); progname, PQntuples(res));
disconnect_and_exit(1); disconnect_and_exit(1);
} }
...@@ -876,13 +876,13 @@ BaseBackup(void) ...@@ -876,13 +876,13 @@ BaseBackup(void)
res = PQgetResult(conn); res = PQgetResult(conn);
if (PQresultStatus(res) != PGRES_TUPLES_OK) if (PQresultStatus(res) != PGRES_TUPLES_OK)
{ {
fprintf(stderr, _("%s: could not get end xlog position from server.\n"), fprintf(stderr, _("%s: could not get end xlog position from server\n"),
progname); progname);
disconnect_and_exit(1); disconnect_and_exit(1);
} }
if (PQntuples(res) != 1) if (PQntuples(res) != 1)
{ {
fprintf(stderr, _("%s: no end point returned from server.\n"), fprintf(stderr, _("%s: no end point returned from server\n"),
progname); progname);
disconnect_and_exit(1); disconnect_and_exit(1);
} }
...@@ -894,7 +894,7 @@ BaseBackup(void) ...@@ -894,7 +894,7 @@ BaseBackup(void)
res = PQgetResult(conn); res = PQgetResult(conn);
if (PQresultStatus(res) != PGRES_COMMAND_OK) if (PQresultStatus(res) != PGRES_COMMAND_OK)
{ {
fprintf(stderr, _("%s: final receive failed: %s\n"), fprintf(stderr, _("%s: final receive failed: %s"),
progname, PQerrorMessage(conn)); progname, PQerrorMessage(conn));
disconnect_and_exit(1); disconnect_and_exit(1);
} }
...@@ -905,7 +905,7 @@ BaseBackup(void) ...@@ -905,7 +905,7 @@ BaseBackup(void)
PQfinish(conn); PQfinish(conn);
if (verbose) if (verbose)
fprintf(stderr, "%s: base backup completed.\n", progname); fprintf(stderr, "%s: base backup completed\n", progname);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment