22
22
*
23
23
*
24
24
* 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 $
26
26
*
27
27
*-------------------------------------------------------------------------
28
28
*/
65
65
#include "pg_backup_archiver.h"
66
66
#include "dumputils.h"
67
67
68
+ #define _ (x ) gettext((x))
68
69
69
70
typedef struct _dumpContext
70
71
{
@@ -420,9 +421,9 @@ main(int argc, char **argv)
420
421
else
421
422
{
422
423
fprintf (stderr ,
423
- gettext ("%s: invalid -X option -- %s\n" ),
424
+ _ ("%s: invalid -X option -- %s\n" ),
424
425
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 );
426
427
exit (1 );
427
428
}
428
429
break ;
@@ -433,7 +434,7 @@ main(int argc, char **argv)
433
434
#ifndef HAVE_GETOPT_LONG
434
435
case '-' :
435
436
fprintf (stderr ,
436
- gettext ("%s was compiled without support for long options.\n"
437
+ _ ("%s was compiled without support for long options.\n"
437
438
"Use --help for help on invocation options.\n" ),
438
439
progname );
439
440
exit (1 );
@@ -444,15 +445,15 @@ main(int argc, char **argv)
444
445
break ;
445
446
#endif
446
447
default :
447
- fprintf (stderr , gettext ("Try '%s --help' for more information.\n" ), progname );
448
+ fprintf (stderr , _ ("Try '%s --help' for more information.\n" ), progname );
448
449
exit (1 );
449
450
}
450
451
}
451
452
452
453
if (optind < (argc - 1 ))
453
454
{
454
455
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"
456
457
"Try '%s --help' for more information.\n" ),
457
458
progname , argv [optind + 1 ], progname );
458
459
exit (1 );
@@ -649,82 +650,80 @@ main(int argc, char **argv)
649
650
static void
650
651
help (const char * progname )
651
652
{
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 " ));
656
657
657
658
#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" ));
724
722
#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" ));
728
727
}
729
728
730
729
static int
0 commit comments