Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d54caa6

Browse files
committed
Break up the long usage messages in pg_dump and pg_restore and
unify the wording, to make life easier for translators. from Dennis Bjorklund
1 parent 03d39ce commit d54caa6

File tree

3 files changed

+161
-164
lines changed

3 files changed

+161
-164
lines changed

src/bin/pg_dump/pg_dump.c

Lines changed: 78 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*
2323
*
2424
* IDENTIFICATION
25-
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.293 2002/08/27 21:04:58 momjian Exp $
25+
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.294 2002/08/28 20:57:22 petere Exp $
2626
*
2727
*-------------------------------------------------------------------------
2828
*/
@@ -65,6 +65,7 @@
6565
#include "pg_backup_archiver.h"
6666
#include "dumputils.h"
6767

68+
#define _(x) gettext((x))
6869

6970
typedef struct _dumpContext
7071
{
@@ -420,9 +421,9 @@ main(int argc, char **argv)
420421
else
421422
{
422423
fprintf(stderr,
423-
gettext("%s: invalid -X option -- %s\n"),
424+
_("%s: invalid -X option -- %s\n"),
424425
progname, optarg);
425-
fprintf(stderr, gettext("Try '%s --help' for more information.\n"), progname);
426+
fprintf(stderr, _("Try '%s --help' for more information.\n"), progname);
426427
exit(1);
427428
}
428429
break;
@@ -433,7 +434,7 @@ main(int argc, char **argv)
433434
#ifndef HAVE_GETOPT_LONG
434435
case '-':
435436
fprintf(stderr,
436-
gettext("%s was compiled without support for long options.\n"
437+
_("%s was compiled without support for long options.\n"
437438
"Use --help for help on invocation options.\n"),
438439
progname);
439440
exit(1);
@@ -444,15 +445,15 @@ main(int argc, char **argv)
444445
break;
445446
#endif
446447
default:
447-
fprintf(stderr, gettext("Try '%s --help' for more information.\n"), progname);
448+
fprintf(stderr, _("Try '%s --help' for more information.\n"), progname);
448449
exit(1);
449450
}
450451
}
451452

452453
if (optind < (argc - 1))
453454
{
454455
fprintf(stderr,
455-
gettext("%s: too many command line options (first is '%s')\n"
456+
_("%s: too many command line options (first is '%s')\n"
456457
"Try '%s --help' for more information.\n"),
457458
progname, argv[optind + 1], progname);
458459
exit(1);
@@ -649,82 +650,80 @@ main(int argc, char **argv)
649650
static void
650651
help(const char *progname)
651652
{
652-
printf(gettext("%s dumps a database as a text file or to other formats.\n\n"), progname);
653-
puts(gettext("Usage:"));
654-
printf(gettext(" %s [options] dbname\n\n"), progname);
655-
puts(gettext("Options:"));
653+
printf(_("%s dumps a database as a text file or to other formats.\n\n"), progname);
654+
printf(_("Usage:\n"));
655+
printf(_(" %s [OPTIONS] DBNAME\n\n"), progname);
656+
printf(_("Options:\n"));
656657

657658
#ifdef HAVE_GETOPT_LONG
658-
puts(gettext(
659-
" -a, --data-only dump only the data, not the schema\n"
660-
" -b, --blobs include large objects in dump\n"
661-
" -c, --clean clean (drop) schema prior to create\n"
662-
" -C, --create include commands to create database in dump\n"
663-
" -d, --inserts dump data as INSERT, rather than COPY, commands\n"
664-
" -D, --column-inserts dump data as INSERT commands with column names\n"
665-
" -f, --file=FILENAME output file name\n"
666-
" -F, --format {c|t|p} output file format (custom, tar, plain text)\n"
667-
" -h, --host=HOSTNAME database server host name\n"
668-
" -i, --ignore-version proceed even when server version mismatches\n"
669-
" pg_dump version\n"
670-
" -o, --oids include OIDs in dump\n"
671-
" -O, --no-owner do not output \\connect commands in plain\n"
672-
" text format\n"
673-
" -p, --port=PORT database server port number\n"
674-
" -R, --no-reconnect disable ALL reconnections to the database in\n"
675-
" plain text format\n"
676-
" -s, --schema-only dump only the schema, no data\n"
677-
" -S, --superuser=NAME specify the superuser user name to use in\n"
678-
" plain text format\n"
679-
" -t, --table=TABLE dump this table only (* for all)\n"
680-
" -U, --username=NAME connect as specified database user\n"
681-
" -v, --verbose verbose mode\n"
682-
" -W, --password force password prompt (should happen automatically)\n"
683-
" -x, --no-privileges do not dump privileges (grant/revoke)\n"
684-
" -X use-set-session-authorization, --use-set-session-authorization\n"
685-
" output SET SESSION AUTHORIZATION commands rather\n"
686-
" than \\connect commands\n"
687-
" -X disable-triggers, --disable-triggers\n"
688-
" disable triggers during data-only restore\n"
689-
" -Z, --compress {0-9} compression level for compressed formats\n"
690-
));
691-
#else
692-
puts(gettext(
693-
" -a dump only the data, not the schema\n"
694-
" -b include large objects in dump\n"
695-
" -c clean (drop) schema prior to create\n"
696-
" -C include commands to create database in dump\n"
697-
" -d dump data as INSERT, rather than COPY, commands\n"
698-
" -D dump data as INSERT commands with column names\n"
699-
" -f FILENAME output file name\n"
700-
" -F {c|t|p} output file format (custom, tar, plain text)\n"
701-
" -h HOSTNAME database server host name\n"
702-
" -i proceed even when server version mismatches\n"
703-
" pg_dump version\n"
704-
" -o include OIDs in dump\n"
705-
" -O do not output \\connect commands in plain\n"
706-
" text format\n"
707-
" -p PORT database server port number\n"
708-
" -R disable ALL reconnections to the database in\n"
709-
" plain text format\n"
710-
" -s dump only the schema, no data\n"
711-
" -S NAME specify the superuser user name to use in\n"
712-
" plain text format\n"
713-
" -t TABLE dump this table only (* for all)\n"
714-
" -U NAME connect as specified database user\n"
715-
" -v verbose mode\n"
716-
" -W force password prompt (should happen automatically)\n"
717-
" -x do not dump privileges (grant/revoke)\n"
718-
" -X use-set-session-authorization\n"
719-
" output SET SESSION AUTHORIZATION commands rather\n"
720-
" than \\connect commands\n"
721-
" -X disable-triggers disable triggers during data-only restore\n"
722-
" -Z {0-9} compression level for compressed formats\n"
723-
));
659+
printf(_( " -a, --data-only dump only the data, not the schema\n"));
660+
printf(_( " -b, --blobs include large objects in dump\n"));
661+
printf(_( " -c, --clean clean (drop) schema prior to create\n"));
662+
printf(_( " -C, --create include commands to create database in dump\n"));
663+
printf(_( " -d, --inserts dump data as INSERT, rather than COPY, commands\n"));
664+
printf(_( " -D, --column-inserts dump data as INSERT commands with column names\n"));
665+
printf(_( " -f, --file=FILENAME output file name\n"));
666+
printf(_( " -F, --format {c|t|p} output file format (custom, tar, plain text)\n"));
667+
printf(_( " -h, --host=HOSTNAME database server host name\n"));
668+
printf(_( " -i, --ignore-version proceed even when server version mismatches\n"
669+
" pg_dump version\n"));
670+
printf(_( " -o, --oids include OIDs in dump\n"));
671+
printf(_( " -O, --no-owner do not output \\connect commands in plain\n"
672+
" text format\n"));
673+
printf(_( " -p, --port=PORT database server port number\n"));
674+
printf(_( " -R, --no-reconnect disable ALL reconnections to the database in\n"
675+
" plain text format\n"));
676+
printf(_( " -s, --schema-only dump only the schema, no data\n"));
677+
printf(_( " -S, --superuser=NAME specify the superuser user name to use in\n"
678+
" plain text format\n"));
679+
printf(_( " -t, --table=TABLE dump this table only (* for all)\n"));
680+
printf(_( " -U, --username=NAME connect as specified database user\n"));
681+
printf(_( " -v, --verbose verbose mode\n"));
682+
printf(_( " -W, --password force password prompt (should happen automatically)\n"));
683+
printf(_( " -x, --no-privileges do not dump privileges (grant/revoke)\n"));
684+
printf(_( " -X use-set-session-authorization, --use-set-session-authorization\n"
685+
" output SET SESSION AUTHORIZATION commands rather\n"
686+
" than \\connect commands\n"));
687+
printf(_( " -X disable-triggers, --disable-triggers\n"
688+
" disable triggers during data-only restore\n"));
689+
printf(_( " -Z, --compress {0-9} compression level for compressed formats\n"));
690+
691+
#else /* not HAVE_GETOPT_LONG */
692+
printf(_( " -a dump only the data, not the schema\n"));
693+
printf(_( " -b include large objects in dump\n"));
694+
printf(_( " -c clean (drop) schema prior to create\n"));
695+
printf(_( " -C include commands to create database in dump\n"));
696+
printf(_( " -d dump data as INSERT, rather than COPY, commands\n"));
697+
printf(_( " -D dump data as INSERT commands with column names\n"));
698+
printf(_( " -f FILENAME output file name\n"));
699+
printf(_( " -F {c|t|p} output file format (custom, tar, plain text)\n"));
700+
printf(_( " -h HOSTNAME database server host name\n"));
701+
printf(_( " -i proceed even when server version mismatches\n"
702+
" pg_dump version\n"));
703+
printf(_( " -o include OIDs in dump\n"));
704+
printf(_( " -O do not output \\connect commands in plain\n"
705+
" text format\n"));
706+
printf(_( " -p PORT database server port number\n"));
707+
printf(_( " -R disable ALL reconnections to the database in\n"
708+
" plain text format\n"));
709+
printf(_( " -s dump only the schema, no data\n"));
710+
printf(_( " -S NAME specify the superuser user name to use in\n"
711+
" plain text format\n"));
712+
printf(_( " -t TABLE dump this table only (* for all)\n"));
713+
printf(_( " -U NAME connect as specified database user\n"));
714+
printf(_( " -v verbose mode\n"));
715+
printf(_( " -W force password prompt (should happen automatically)\n"));
716+
printf(_( " -x do not dump privileges (grant/revoke)\n"));
717+
printf(_( " -X use-set-session-authorization\n"
718+
" output SET SESSION AUTHORIZATION commands rather\n"
719+
" than \\connect commands\n"));
720+
printf(_( " -X disable-triggers disable triggers during data-only restore\n"));
721+
printf(_( " -Z {0-9} compression level for compressed formats\n"));
724722
#endif
725-
puts(gettext("If no database name is not supplied, then the PGDATABASE environment\n"
726-
"variable value is used.\n\n"
727-
"Report bugs to <pgsql-bugs@postgresql.org>."));
723+
724+
printf(_("\nIf no database name is not supplied, then the PGDATABASE environment\n"
725+
"variable value is used.\n\n"));
726+
printf(_("Report bugs to <pgsql-bugs@postgresql.org>.\n"));
728727
}
729728

730729
static int

src/bin/pg_dump/pg_dumpall.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1994, Regents of the University of California
77
*
88
*
9-
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.3 2002/08/28 18:25:05 petere Exp $
9+
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.4 2002/08/28 20:57:22 petere Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -237,7 +237,7 @@ help(void)
237237
printf(_(" -h HOSTNAME database server host name\n"));
238238
printf(_(" -i proceed even when server version mismatches\n"
239239
" pg_dumpall version\n"));
240-
printf(_(" -o include oids in dump\n"));
240+
printf(_(" -o include OIDs in dump\n"));
241241
printf(_(" -p PORT database server port number\n"));
242242
printf(_(" -U NAME connect as specified database user\n"));
243243
printf(_(" -v verbose mode\n"));

0 commit comments

Comments
 (0)