summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut2002-10-18 22:05:36 +0000
committerPeter Eisentraut2002-10-18 22:05:36 +0000
commit630a0991cd4e32587225e0456573df5ef87854f0 (patch)
tree9ceda258717e9d94ede6c8a06d570f6c3a1dc0bc
parent3a7caa197feecaa1484b021e62d65ce6237d31da (diff)
Improve formatting of --help output.
-rw-r--r--src/backend/postmaster/postmaster.c4
-rw-r--r--src/backend/tcop/postgres.c14
-rw-r--r--src/bin/initdb/initdb.sh36
-rw-r--r--src/bin/initlocation/initlocation.sh3
-rw-r--r--src/bin/ipcclean/ipcclean.sh3
-rw-r--r--src/bin/pg_config/pg_config.sh8
-rw-r--r--src/bin/pg_controldata/pg_controldata.c2
-rwxr-xr-xsrc/bin/pg_ctl/pg_ctl.sh29
-rw-r--r--src/bin/pg_dump/pg_dump.c61
-rw-r--r--src/bin/pg_dump/pg_dumpall.c27
-rw-r--r--src/bin/pg_dump/pg_restore.c65
-rw-r--r--src/bin/pg_resetxlog/pg_resetxlog.c14
-rw-r--r--src/bin/psql/help.c70
-rw-r--r--src/bin/psql/startup.c5
-rw-r--r--src/bin/scripts/clusterdb27
-rw-r--r--src/bin/scripts/createdb25
-rw-r--r--src/bin/scripts/createlang.sh17
-rw-r--r--src/bin/scripts/createuser35
-rw-r--r--src/bin/scripts/dropdb17
-rw-r--r--src/bin/scripts/droplang15
-rw-r--r--src/bin/scripts/dropuser17
-rw-r--r--src/bin/scripts/vacuumdb29
-rw-r--r--src/interfaces/ecpg/preproc/ecpg.c28
23 files changed, 302 insertions, 249 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 384875664d..1354338040 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -846,7 +846,7 @@ static void
usage(const char *progname)
{
printf(gettext("%s is the PostgreSQL server.\n\n"), progname);
- printf(gettext("Usage:\n %s [options...]\n\n"), progname);
+ printf(gettext("Usage:\n %s [OPTION]...\n\n"), progname);
printf(gettext("Options:\n"));
#ifdef USE_ASSERT_CHECKING
printf(gettext(" -A 1|0 enable/disable run-time assert checking\n"));
@@ -867,6 +867,8 @@ usage(const char *progname)
printf(gettext(" -o OPTIONS pass 'OPTIONS' to each backend server\n"));
printf(gettext(" -p PORT port number to listen on (default %d)\n"), DEF_PGPORT);
printf(gettext(" -S silent mode (start in background without logging output)\n"));
+ printf(gettext(" --help show this help, then exit\n"));
+ printf(gettext(" --version output version information, then exit\n"));
printf(gettext("\nDeveloper options:\n"));
printf(gettext(" -n do not reinitialize shared memory after abnormal exit\n"));
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index 6cfba97813..c77f794377 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -1156,14 +1156,14 @@ usage(char *progname)
{
printf("%s is the PostgreSQL stand-alone backend. It is not\nintended to be used by normal users.\n\n", progname);
- printf("Usage:\n %s [options...] [dbname]\n\n", progname);
+ printf("Usage:\n %s [OPTION]... [DBNAME]\n\n", progname);
printf("Options:\n");
#ifdef USE_ASSERT_CHECKING
printf(" -A 1|0 enable/disable run-time assert checking\n");
#endif
printf(" -B NBUFFERS number of shared buffers (default %d)\n", DEF_NBUFFERS);
printf(" -c NAME=VALUE set run-time parameter\n");
- printf(" -d 1-5,0 debugging level (0 is off)\n");
+ printf(" -d 0-5 debugging level (0 is off)\n");
printf(" -D DATADIR database directory\n");
printf(" -e use European date format\n");
printf(" -E echo query before execution\n");
@@ -1173,11 +1173,13 @@ usage(char *progname)
printf(" -P disable system indexes\n");
printf(" -s show statistics after each query\n");
printf(" -S SORT-MEM set amount of memory for sorts (in kbytes)\n");
- printf("Developer options:\n");
- printf(" -f [s|i|n|m|h] forbid use of some plan types\n");
+ printf(" --help show this help, then exit\n");
+ printf(" --version output version information, then exit\n");
+ printf("\nDeveloper options:\n");
+ printf(" -f s|i|n|m|h forbid use of some plan types\n");
printf(" -i do not execute queries\n");
printf(" -O allow system table structure changes\n");
- printf(" -t [pa|pl|ex] show timings after each query\n");
+ printf(" -t pa|pl|ex show timings after each query\n");
printf(" -W NUM wait NUM seconds to allow attach from a debugger\n");
printf("\nReport bugs to <[email protected]>.\n");
}
@@ -1767,7 +1769,7 @@ PostgresMain(int argc, char *argv[], const char *username)
if (!IsUnderPostmaster)
{
puts("\nPOSTGRES backend interactive interface ");
- puts("$Revision: 1.303 $ $Date: 2002/10/14 23:49:20 $\n");
+ puts("$Revision: 1.304 $ $Date: 2002/10/18 22:05:35 $\n");
}
/*
diff --git a/src/bin/initdb/initdb.sh b/src/bin/initdb/initdb.sh
index ebaf8dd35f..664921fb5a 100644
--- a/src/bin/initdb/initdb.sh
+++ b/src/bin/initdb/initdb.sh
@@ -335,24 +335,30 @@ if [ "$usage" ]; then
echo "$CMDNAME initializes a PostgreSQL database cluster."
echo
echo "Usage:"
- echo " $CMDNAME [options] datadir"
+ echo " $CMDNAME [OPTION]... [DATADIR]"
echo
echo "Options:"
- echo " [-D, --pgdata] DATADIR Location for this database cluster"
- echo " -W, --pwprompt Prompt for a password for the new superuser"
- echo " -E, --encoding ENCODING Set default encoding for new databases"
- echo " --locale LOCALE Initialize database cluster with given locale"
- echo " --lc-collate, --lc-ctype, --lc-messages LOCALE"
- echo " --lc-monetary, --lc-numeric, --lc-time LOCALE"
- echo " Initialize database cluster with given locale"
- echo " in the respective category"
- echo " (default taken from environment)"
- echo " --no-locale Equivalent to --locale=C"
- echo " -U, --username NAME Database superuser name"
+ echo " [-D, --pgdata=]DATADIR location for this database cluster"
+ echo " -E, --encoding=ENCODING set default encoding for new databases"
+ echo " --locale=LOCALE initialize database cluster with given locale"
+ echo " --lc-collate, --lc-ctype, --lc-messages=LOCALE"
+ echo " --lc-monetary, --lc-numeric, --lc-time=LOCALE"
+ echo " initialize database cluster with given locale"
+ echo " in the respective category (default taken from"
+ echo " environment)"
+ echo " --no-locale equivalent to --locale=C"
+ echo " -U, --username=NAME database superuser name"
+ echo " -W, --pwprompt prompt for a password for the new superuser"
+ echo " --help show this help, then exit"
+ echo " --version output version information, then exit"
+ echo
echo "Less commonly used options: "
- echo " -L DIRECTORY Where to find the input files"
- echo " -d, --debug Generate lots of debugging output"
- echo " -n, --noclean Do not clean up after errors"
+ echo " -d, --debug generate lots of debugging output"
+ echo " -L DIRECTORY where to find the input files"
+ echo " -n, --noclean do not clean up after errors"
+ echo
+ echo "If the data directory is not specified, the environment variable PGDATA"
+ echo "is used."
echo
echo "Report bugs to <[email protected]>."
exit 0
diff --git a/src/bin/initlocation/initlocation.sh b/src/bin/initlocation/initlocation.sh
index 3723c2dc74..85d4001007 100644
--- a/src/bin/initlocation/initlocation.sh
+++ b/src/bin/initlocation/initlocation.sh
@@ -64,7 +64,8 @@ done
if [ "$usage" ]; then
- echo "$CMDNAME initializes an alternative filesystem location for database creation."
+ echo "$CMDNAME initializes an alternative filesystem location for database"
+ echo "creation."
echo ""
echo "Usage:"
echo " $CMDNAME LOCATION"
diff --git a/src/bin/ipcclean/ipcclean.sh b/src/bin/ipcclean/ipcclean.sh
index d2d246e295..b8dd82acb7 100644
--- a/src/bin/ipcclean/ipcclean.sh
+++ b/src/bin/ipcclean/ipcclean.sh
@@ -6,7 +6,8 @@
CMDNAME=`basename $0`
if [ "$1" = '-?' -o "$1" = "--help" ]; then
- echo "$CMDNAME cleans up shared memory and semaphores from aborted PostgreSQL backends."
+ echo "$CMDNAME cleans up shared memory and semaphores from aborted PostgreSQL"
+ echo "backends."
echo
echo "Usage:"
echo " $CMDNAME"
diff --git a/src/bin/pg_config/pg_config.sh b/src/bin/pg_config/pg_config.sh
index 9d52973ff2..7faf108ea1 100644
--- a/src/bin/pg_config/pg_config.sh
+++ b/src/bin/pg_config/pg_config.sh
@@ -23,9 +23,10 @@ val_version='@version@'
help="\
$me provides information about the installed version of PostgreSQL.
-Usage: $me --bindir | --includedir | --includedir-server | --libdir | --pkglibdir | --configure | --version
+Usage:
+ $me OPTION...
-Operation modes:
+Options:
--bindir show location of user executables
--includedir show location of C header files of the client
interfaces
@@ -34,7 +35,8 @@ Operation modes:
--pkglibdir show location of dynamically loadable modules
--configure show options given to 'configure' script when
PostgreSQL was built
- --version show the PostgreSQL version and exit
+ --version show the PostgreSQL version, then exit
+ --help show this help, then exit
Report bugs to <[email protected]>."
diff --git a/src/bin/pg_controldata/pg_controldata.c b/src/bin/pg_controldata/pg_controldata.c
index fc0caff3c0..c88c397130 100644
--- a/src/bin/pg_controldata/pg_controldata.c
+++ b/src/bin/pg_controldata/pg_controldata.c
@@ -25,7 +25,7 @@
static void
usage(const char *progname)
{
- printf(_("%s displays PostgreSQL database cluster control information.\n"), progname);
+ printf(_("%s displays PostgreSQL database cluster control information.\n\n"), progname);
printf(_("Usage:\n %s [DATADIR]\n\n"), progname);
printf(_("If not data directory is specified, the environment variable PGDATA\nis used.\n\n"));
printf(_("Report bugs to <[email protected]>.\n"));
diff --git a/src/bin/pg_ctl/pg_ctl.sh b/src/bin/pg_ctl/pg_ctl.sh
index 47864b1f7d..fa8cbad5b3 100755
--- a/src/bin/pg_ctl/pg_ctl.sh
+++ b/src/bin/pg_ctl/pg_ctl.sh
@@ -26,29 +26,30 @@ Usage:
$CMDNAME status [-D DATADIR]
Common options:
- -D DATADIR Location of the database storage area
- -s Only print errors, no informational messages
- -w Wait until operation completes
- -W Do not wait until operation completes
+ -D DATADIR location of the database storage area
+ -s only print errors, no informational messages
+ -w wait until operation completes
+ -W do not wait until operation completes
+ --help show this help, then exit
+ --version output version information, then exit
(The default is to wait for shutdown, but not for start or restart.)
If the -D option is omitted, the environment variable PGDATA is used.
Options for start or restart:
- -l FILENAME Write (or append) server log to FILENAME. The
- use of this option is highly recommended.
- -o OPTIONS Command line options to pass to the postmaster
- (PostgreSQL server executable)
- -p PATH-TO-POSTMASTER Normally not necessary
+ -l FILENAME write (or append) server log to FILENAME. The
+ use of this option is highly recommended.
+ -o OPTIONS command line options to pass to the postmaster
+ (PostgreSQL server executable)
+ -p PATH-TO-POSTMASTER normally not necessary
Options for stop or restart:
- -m SHUTDOWN-MODE May be 'smart', 'fast', or 'immediate'
+ -m SHUTDOWN-MODE may be 'smart', 'fast', or 'immediate'
Shutdown modes are:
- smart Quit after all clients have disconnected
- fast Quit directly, with proper shutdown
- immediate Quit without complete shutdown; will lead
- to recovery run on restart
+ smart quit after all clients have disconnected
+ fast quit directly, with proper shutdown
+ immediate quit without complete shutdown; will lead to recovery on restart
Report bugs to <[email protected]>."
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 319356bd5f..2629e6cc3a 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -656,9 +656,28 @@ help(const char *progname)
{
printf(_("%s dumps a database as a text file or to other formats.\n\n"), progname);
printf(_("Usage:\n"));
- printf(_(" %s [OPTIONS] DBNAME\n\n"), progname);
- printf(_("Options:\n"));
+ printf(_(" %s [OPTION]... [DBNAME]\n"), progname);
+ printf(_("\nGeneral options:\n"));
+#ifdef HAVE_GETOPT_LONG
+ printf(_(" -f, --file=FILENAME output file name\n"));
+ printf(_(" -F, --format=c|t|p output file format (custom, tar, plain text)\n"));
+ printf(_(" -i, --ignore-version proceed even when server version mismatches\n"
+ " pg_dump version\n"));
+ printf(_(" -v, --verbose verbose mode\n"));
+ printf(_(" -Z, --compress=0-9 compression level for compressed formats\n"));
+#else /* not HAVE_GETOPT_LONG */
+ printf(_(" -f FILENAME output file name\n"));
+ printf(_(" -F c|t|p output file format (custom, tar, plain text)\n"));
+ printf(_(" -i proceed even when server version mismatches\n"
+ " pg_dump version\n"));
+ printf(_(" -v verbose mode\n"));
+ printf(_(" -Z 0-9 compression level for compressed formats\n"));
+#endif /* not HAVE_GETOPT_LONG */
+ printf(_(" --help show this help, then exit\n"));
+ printf(_(" --version output version information, then exit\n"));
+
+ printf(_("\nOptions controlling the output content:\n"));
#ifdef HAVE_GETOPT_LONG
printf(_(" -a, --data-only dump only the data, not the schema\n"));
printf(_(" -b, --blobs include large objects in dump\n"));
@@ -666,64 +685,56 @@ help(const char *progname)
printf(_(" -C, --create include commands to create database in dump\n"));
printf(_(" -d, --inserts dump data as INSERT, rather than COPY, commands\n"));
printf(_(" -D, --column-inserts dump data as INSERT commands with column names\n"));
- printf(_(" -f, --file=FILENAME output file name\n"));
- printf(_(" -F, --format {c|t|p} output file format (custom, tar, plain text)\n"));
- printf(_(" -h, --host=HOSTNAME database server host name\n"));
- printf(_(" -i, --ignore-version proceed even when server version mismatches\n"
- " pg_dump version\n"));
printf(_(" -o, --oids include OIDs in dump\n"));
printf(_(" -O, --no-owner do not output \\connect commands in plain\n"
" text format\n"));
- printf(_(" -p, --port=PORT database server port number\n"));
printf(_(" -R, --no-reconnect disable ALL reconnections to the database in\n"
" plain text format\n"));
printf(_(" -s, --schema-only dump only the schema, no data\n"));
printf(_(" -S, --superuser=NAME specify the superuser user name to use in\n"
" plain text format\n"));
printf(_(" -t, --table=TABLE dump this table only (* for all)\n"));
- printf(_(" -U, --username=NAME connect as specified database user\n"));
- printf(_(" -v, --verbose verbose mode\n"));
- printf(_(" -W, --password force password prompt (should happen automatically)\n"));
printf(_(" -x, --no-privileges do not dump privileges (grant/revoke)\n"));
printf(_(" -X use-set-session-authorization, --use-set-session-authorization\n"
" output SET SESSION AUTHORIZATION commands rather\n"
" than \\connect commands\n"));
printf(_(" -X disable-triggers, --disable-triggers\n"
" disable triggers during data-only restore\n"));
- printf(_(" -Z, --compress {0-9} compression level for compressed formats\n"));
-
-#else /* not HAVE_GETOPT_LONG */
+#else /* not HAVE_GETOPT_LONG */
printf(_(" -a dump only the data, not the schema\n"));
printf(_(" -b include large objects in dump\n"));
printf(_(" -c clean (drop) schema prior to create\n"));
printf(_(" -C include commands to create database in dump\n"));
printf(_(" -d dump data as INSERT, rather than COPY, commands\n"));
printf(_(" -D dump data as INSERT commands with column names\n"));
- printf(_(" -f FILENAME output file name\n"));
- printf(_(" -F {c|t|p} output file format (custom, tar, plain text)\n"));
- printf(_(" -h HOSTNAME database server host name\n"));
- printf(_(" -i proceed even when server version mismatches\n"
- " pg_dump version\n"));
printf(_(" -o include OIDs in dump\n"));
printf(_(" -O do not output \\connect commands in plain\n"
" text format\n"));
- printf(_(" -p PORT database server port number\n"));
printf(_(" -R disable ALL reconnections to the database in\n"
" plain text format\n"));
printf(_(" -s dump only the schema, no data\n"));
printf(_(" -S NAME specify the superuser user name to use in\n"
" plain text format\n"));
printf(_(" -t TABLE dump this table only (* for all)\n"));
- printf(_(" -U NAME connect as specified database user\n"));
- printf(_(" -v verbose mode\n"));
- printf(_(" -W force password prompt (should happen automatically)\n"));
printf(_(" -x do not dump privileges (grant/revoke)\n"));
printf(_(" -X use-set-session-authorization\n"
" output SET SESSION AUTHORIZATION commands rather\n"
" than \\connect commands\n"));
printf(_(" -X disable-triggers disable triggers during data-only restore\n"));
- printf(_(" -Z {0-9} compression level for compressed formats\n"));
-#endif
+#endif /* not HAVE_GETOPT_LONG */
+
+ printf(_("\nConnection options:\n"));
+#ifdef HAVE_GETOPT_LONG
+ printf(_(" -h, --host=HOSTNAME database server host name\n"));
+ printf(_(" -p, --port=PORT database server port number\n"));
+ printf(_(" -U, --username=NAME connect as specified database user\n"));
+ printf(_(" -W, --password force password prompt (should happen automatically)\n"));
+#else /* not HAVE_GETOPT_LONG */
+ printf(_(" -h HOSTNAME database server host name\n"));
+ printf(_(" -p PORT database server port number\n"));
+ printf(_(" -U NAME connect as specified database user\n"));
+ printf(_(" -W force password prompt (should happen automatically)\n"));
+#endif /* not HAVE_GETOPT_LONG */
printf(_("\nIf no database name is not supplied, then the PGDATABASE environment\n"
"variable value is used.\n\n"));
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c
index d0647fe084..b3c7bcf0a0 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -213,36 +213,43 @@ help(void)
{
printf(_("%s extracts a PostgreSQL database cluster into an SQL script file.\n\n"), progname);
printf(_("Usage:\n"));
- printf(_(" %s [OPTIONS]\n\n"), progname);
+ printf(_(" %s [OPTION]...\n"), progname);
- printf(_("Options:\n"));
+ printf(_("\nOptions:\n"));
#ifdef HAVE_GETOPT_LONG
printf(_(" -c, --clean clean (drop) databases prior to create\n"));
printf(_(" -d, --inserts dump data as INSERT, rather than COPY, commands\n"));
printf(_(" -D, --column-inserts dump data as INSERT commands with column names\n"));
printf(_(" -g, --globals-only dump only global objects, no databases\n"));
- printf(_(" -h, --host=HOSTNAME database server host name\n"));
printf(_(" -i, --ignore-version proceed even when server version mismatches\n"
" pg_dumpall version\n"));
printf(_(" -o, --oids include OIDs in dump\n"));
- printf(_(" -p, --port=PORT database server port number\n"));
- printf(_(" -U, --username=NAME connect as specified database user\n"));
printf(_(" -v, --verbose verbose mode\n"));
- printf(_(" -W, --password force password prompt (should happen automatically)\n"));
-#else /* not HAVE_GETOPT_LONG */
+#else /* not HAVE_GETOPT_LONG */
printf(_(" -c clean (drop) databases prior to create\n"));
printf(_(" -d dump data as INSERT, rather than COPY, commands\n"));
printf(_(" -D dump data as INSERT commands with column names\n"));
printf(_(" -g dump only global objects, no databases\n"));
- printf(_(" -h HOSTNAME database server host name\n"));
printf(_(" -i proceed even when server version mismatches\n"
" pg_dumpall version\n"));
printf(_(" -o include OIDs in dump\n"));
+ printf(_(" -v verbose mode\n"));
+#endif /* not HAVE_GETOPT_LONG */
+ printf(_(" --help show this help, then exit\n"));
+ printf(_(" --version output version information, then exit\n"));
+
+ printf(_("\nConnection options:\n"));
+#ifdef HAVE_GETOPT_LONG
+ printf(_(" -h, --host=HOSTNAME database server host name\n"));
+ printf(_(" -p, --port=PORT database server port number\n"));
+ printf(_(" -U, --username=NAME connect as specified database user\n"));
+ printf(_(" -W, --password force password prompt (should happen automatically)\n"));
+#else /* not HAVE_GETOPT_LONG */
+ printf(_(" -h HOSTNAME database server host name\n"));
printf(_(" -p PORT database server port number\n"));
printf(_(" -U NAME connect as specified database user\n"));
- printf(_(" -v verbose mode\n"));
printf(_(" -W force password prompt (should happen automatically)\n"));
-#endif /* not HAVE_GETOPT_LONG */
+#endif /* not HAVE_GETOPT_LONG */
printf(_("\nThe SQL script will be written to the standard output.\n\n"));
printf(_("Report bugs to <[email protected]>.\n"));
diff --git a/src/bin/pg_dump/pg_restore.c b/src/bin/pg_dump/pg_restore.c
index c15bf28c91..5b403b905a 100644
--- a/src/bin/pg_dump/pg_restore.c
+++ b/src/bin/pg_dump/pg_restore.c
@@ -375,27 +375,39 @@ usage(const char *progname)
{
printf(_("%s restores a PostgreSQL database from an archive created by pg_dump.\n\n"), progname);
printf(_("Usage:\n"));
- printf(_(" %s [OPTIONS] [FILE]\n\n"), progname);
- printf(_("Options:\n"));
+ printf(_(" %s [OPTION]... [FILE]\n"), progname);
+ printf(_("\nGeneral options:\n"));
#ifdef HAVE_GETOPT_LONG
- printf(_(" -a, --data-only restore only the data, no schema\n"));
- printf(_(" -c, --clean clean (drop) schema prior to create\n"));
- printf(_(" -C, --create issue commands to create the database\n"));
printf(_(" -d, --dbname=NAME output database name\n"));
printf(_(" -f, --file=FILENAME output file name\n"));
- printf(_(" -F, --format={c|t} specify backup file format\n"));
- printf(_(" -h, --host=HOSTNAME database server host name\n"));
+ printf(_(" -F, --format=c|t specify backup file format\n"));
printf(_(" -i, --ignore-version proceed even when server version mismatches\n"));
- printf(_(" -I, --index=NAME restore named index\n"));
printf(_(" -l, --list print summarized TOC of the archive\n"));
+ printf(_(" -v, --verbose verbose mode\n"));
+#else /* not HAVE_GETOPT_LONG */
+ printf(_(" -d NAME output database name\n"));
+ printf(_(" -f FILENAME output file name\n"));
+ printf(_(" -F c|t specify backup file format\n"));
+ printf(_(" -i proceed even when server version mismatches\n"));
+ printf(_(" -l print summarized TOC of the archive\n"));
+ printf(_(" -v verbose mode\n"));
+#endif /* not HAVE_GETOPT_LONG */
+ printf(_(" --help show this help, then exit\n"));
+ printf(_(" --version output version information, then exit\n"));
+
+ printf(_("\nOptions controlling the output content:\n"));
+#ifdef HAVE_GETOPT_LONG
+ printf(_(" -a, --data-only restore only the data, no schema\n"));
+ printf(_(" -c, --clean clean (drop) schema prior to create\n"));
+ printf(_(" -C, --create issue commands to create the database\n"));
+ printf(_(" -I, --index=NAME restore named index\n"));
printf(_(" -L, --use-list=FILENAME use specified table of contents for ordering\n"
" output from this file\n"));
printf(_(" -N, --orig-order restore in original dump order\n"));
printf(_(" -o, --oid-order restore in OID order\n"));
printf(_(" -O, --no-owner do not reconnect to database to match\n"
" object owner\n"));
- printf(_(" -p, --port=PORT database server port number\n"));
printf(_(" -P, --function=NAME(args)\n"
" restore named function\n"));
printf(_(" -r, --rearrange rearrange output to put indexes etc. at end\n"));
@@ -405,34 +417,23 @@ usage(const char *progname)
" disabling triggers\n"));
printf(_(" -t, --table=NAME restore named table\n"));
printf(_(" -T, --trigger=NAME restore named trigger\n"));
- printf(_(" -U, --username=NAME connect as specified database user\n"));
- printf(_(" -v, --verbose verbose mode\n"));
- printf(_(" -W, --password force password prompt (should happen automatically)\n"));
printf(_(" -x, --no-privileges skip restoration of access privileges (grant/revoke)\n"));
printf(_(" -X use-set-session-authorization, --use-set-session-authorization\n"
" use SET SESSION AUTHORIZATION commands instead\n"
- " of reconnecting, if possible\n"));
+ " of reconnecting, if possible\n"));
printf(_(" -X disable-triggers, --disable-triggers\n"
" disable triggers during data-only restore\n"));
-
-#else /* not HAVE_GETOPT_LONG */
+#else /* not HAVE_GETOPT_LONG */
printf(_(" -a restore only the data, no schema\n"));
printf(_(" -c clean (drop) schema prior to create\n"));
printf(_(" -C issue commands to create the database\n"));
- printf(_(" -d NAME output database name\n"));
- printf(_(" -f FILENAME output file name\n"));
- printf(_(" -F {c|t} specify backup file format\n"));
- printf(_(" -h HOSTNAME database server host name\n"));
- printf(_(" -i proceed even when server version mismatches\n"));
printf(_(" -I NAME restore named index\n"));
- printf(_(" -l print summarized TOC of the archive\n"));
printf(_(" -L FILENAME use specified table of contents for ordering\n"
" output from this file\n"));
printf(_(" -N restore in original dump order\n"));
printf(_(" -o restore in OID order\n"));
printf(_(" -O do not reconnect to database to match\n"
" object owner\n"));
- printf(_(" -p PORT database server port number\n"));
printf(_(" -P NAME(args) restore named function\n"));
printf(_(" -r rearrange output to put indexes etc. at end\n"));
printf(_(" -R disallow ALL reconnections to the database\n"));
@@ -441,15 +442,25 @@ usage(const char *progname)
" disabling triggers\n"));
printf(_(" -t NAME restore named table\n"));
printf(_(" -T NAME restore named trigger\n"));
- printf(_(" -U NAME connect as specified database user\n"));
- printf(_(" -v verbose mode\n"));
- printf(_(" -W force password prompt (should happen automatically)\n"));
printf(_(" -x skip restoration of access privileges (grant/revoke)\n"));
printf(_(" -X use-set-session-authorization\n"
" use SET SESSION AUTHORIZATION commands instead\n"
- " of reconnecting, if possible\n"));
+ " of reconnecting, if possible\n"));
printf(_(" -X disable-triggers disable triggers during data-only restore\n"));
-#endif
+#endif /* not HAVE_GETOPT_LONG */
+
+ printf(_("\nConnection options:\n"));
+#ifdef HAVE_GETOPT_LONG
+ printf(_(" -h, --host=HOSTNAME database server host name\n"));
+ printf(_(" -p, --port=PORT database server port number\n"));
+ printf(_(" -U, --username=NAME connect as specified database user\n"));
+ printf(_(" -W, --password force password prompt (should happen automatically)\n"));
+#else /* not HAVE_GETOPT_LONG */
+ printf(_(" -h HOSTNAME database server host name\n"));
+ printf(_(" -p PORT database server port number\n"));
+ printf(_(" -U NAME connect as specified database user\n"));
+ printf(_(" -W force password prompt (should happen automatically)\n"));
+#endif /* not HAVE_GETOPT_LONG */
printf(_("\nIf no input file name is supplied, then standard input is used.\n\n"));
printf(_("Report bugs to <[email protected]>.\n"));
diff --git a/src/bin/pg_resetxlog/pg_resetxlog.c b/src/bin/pg_resetxlog/pg_resetxlog.c
index ec1c730020..3e51e13e37 100644
--- a/src/bin/pg_resetxlog/pg_resetxlog.c
+++ b/src/bin/pg_resetxlog/pg_resetxlog.c
@@ -692,12 +692,14 @@ static void
usage(void)
{
printf(_("%s resets the PostgreSQL transaction log.\n\n"), progname);
- printf(_("Usage:\n %s [OPTIONS] DATADIR\n\n"), progname);
+ printf(_("Usage:\n %s [OPTION]... DATADIR\n\n"), progname);
printf(_("Options:\n"));
- printf(_(" -f force update to be done\n"));
- printf(_(" -l FILEID,SEG force minimum WAL starting location for new transaction log\n"));
- printf(_(" -n no update, just show extracted control values (for testing)\n"));
- printf(_(" -o OID set next OID\n"));
- printf(_(" -x XID set next transaction ID\n"));
+ printf(_(" -f force update to be done\n"));
+ printf(_(" -l FILEID,SEG force minimum WAL starting location for new transaction log\n"));
+ printf(_(" -n no update, just show extracted control values (for testing)\n"));
+ printf(_(" -o OID set next OID\n"));
+ printf(_(" -x XID set next transaction ID\n"));
+ printf(_(" --help show this help, then exit\n"));
+ printf(_(" --version output version information, then exit\n"));
printf(_("\nReport bugs to <[email protected]>.\n"));
}
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index 8b67be050b..339b24f0bf 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -83,58 +83,58 @@ usage(void)
printf(_("This is psql %s, the PostgreSQL interactive terminal.\n\n"),
PG_VERSION);
puts(_("Usage:"));
- puts(_(" psql [OPTIONS] [DBNAME [USERNAME]]\n"));
- puts(_("Options:"));
- puts(_(" -a Echo all input from script"));
- puts(_(" -A Unaligned table output mode (-P format=unaligned)"));
- puts(_(" -c COMMAND Run only single command (SQL or internal) and exit"));
+ puts(_(" psql [OPTIONS]... [DBNAME [USERNAME]]\n"));
+ puts(_("General options:"));
/* Display default database */
env = getenv("PGDATABASE");
if (!env)
env = user;
- printf(_(" -d DBNAME Specify database name to connect to (default: %s)\n"), env);
-
- puts(_(" -e Echo commands sent to server"));
- puts(_(" -E Display queries that internal commands generate"));
- puts(_(" -f FILENAME Execute commands from file, then exit"));
- printf(_(" -F STRING Set field separator (default: \"%s\") (-P fieldsep=)\n"),
+ printf(_(" -d DBNAME specify database name to connect to (default: %s)\n"), env);
+ puts(_(" -c COMMAND run only single command (SQL or internal) and exit"));
+ puts(_(" -f FILENAME execute commands from file, then exit"));
+ puts(_(" -l list available databases, then exit"));
+ puts(_(" -v NAME=VALUE set psql variable 'NAME' to 'VALUE'"));
+ puts(_(" -X do not read startup file (~/.psqlrc)"));
+ puts(_(" --help show this help, then exit"));
+ puts(_(" --version output version information, then exit"));
+
+ puts(_("\nInput and output options:"));
+ puts(_(" -a echo all input from script"));
+ puts(_(" -e echo commands sent to server"));
+ puts(_(" -E display queries that internal commands generate"));
+ puts(_(" -q run quietly (no messages, only query output)"));
+ puts(_(" -o FILENAME send query results to file (or |pipe)"));
+ puts(_(" -n disable enhanced command line editing (readline)"));
+ puts(_(" -s single step mode (confirm each query)"));
+ puts(_(" -S single line mode (end of line terminates SQL command)"));
+
+ puts(_("\nOutput format options:"));
+ puts(_(" -A unaligned table output mode (-P format=unaligned)"));
+ puts(_(" -H HTML table output mode (-P format=html)"));
+ puts(_(" -t print rows only (-P tuples_only)"));
+ puts(_(" -T TEXT set HTML table tag attributes (width, border) (-P tableattr=)"));
+ puts(_(" -x turn on expanded table output (-P expanded)"));
+ puts(_(" -P VAR[=ARG] set printing option 'VAR' to 'ARG' (see \\pset command)"));
+ printf(_(" -F STRING set field separator (default: \"%s\") (-P fieldsep=)\n"),
DEFAULT_FIELD_SEP);
+ puts(_(" -R STRING set record separator (default: newline) (-P recordsep=)"));
+ puts(_("\nConnection options:"));
/* Display default host */
env = getenv("PGHOST");
- printf(_(" -h HOSTNAME Specify database server host (default: %s)\n"),
+ printf(_(" -h HOSTNAME specify database server host (default: %s)\n"),
env ? env : _("local socket"));
-
- puts(_(" -H HTML table output mode (-P format=html)"));
- puts(_(" -l List available databases, then exit"));
- puts(_(" -n Disable enhanced command line editing (readline)"));
- puts(_(" -o FILENAME Send query results to file (or |pipe)"));
-
/* Display default port */
env = getenv("PGPORT");
- printf(_(" -p PORT Specify database server port (default: %s)\n"),
+ printf(_(" -p PORT specify database server port (default: %s)\n"),
env ? env : DEF_PGPORT_STR);
-
- puts(_(" -P VAR[=ARG] Set printing option 'VAR' to 'ARG' (see \\pset command)"));
- puts(_(" -q Run quietly (no messages, only query output)"));
- puts(_(" -R STRING Set record separator (default: newline) (-P recordsep=)"));
- puts(_(" -s Single step mode (confirm each query)"));
- puts(_(" -S Single line mode (end of line terminates SQL command)"));
- puts(_(" -t Print rows only (-P tuples_only)"));
- puts(_(" -T TEXT Set HTML table tag attributes (width, border) (-P tableattr=)"));
-
/* Display default user */
env = getenv("PGUSER");
if (!env)
env = user;
- printf(_(" -U NAME Specify database user name (default: %s)\n"), env);
-
- puts(_(" -v NAME=VALUE Set psql variable 'NAME' to 'VALUE'"));
- puts(_(" -V Show version information and exit"));
- puts(_(" -W Prompt for password (should happen automatically)"));
- puts(_(" -x Turn on expanded table output (-P expanded)"));
- puts(_(" -X Do not read startup file (~/.psqlrc)"));
+ printf(_(" -U NAME specify database user name (default: %s)\n"), env);
+ puts(_(" -W prompt for password (should happen automatically)"));
puts(_(
"\nFor more information, type \"\\?\" (for internal commands) or \"\\help\"\n"
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 708485069c..82d8b6bbe4 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -640,11 +640,6 @@ showVersion(void)
#if defined(USE_READLINE)
puts(gettext("contains support for command-line editing"));
#endif
-
- puts(gettext("Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group\n"
- "Portions Copyright (c) 1996, Regents of the University of California\n"
- "Read the file COPYRIGHT or use the command \\copyright to see the\n"
- "usage and distribution terms."));
}
diff --git a/src/bin/scripts/clusterdb b/src/bin/scripts/clusterdb
index b1fe9bbf12..51cdac5178 100644
--- a/src/bin/scripts/clusterdb
+++ b/src/bin/scripts/clusterdb
@@ -109,22 +109,25 @@ do
done
if [ "$usage" ]; then
- echo "$CMDNAME cluster all previously clustered tables in a database"
+ echo "$CMDNAME cluster all previously clustered tables in a database."
echo
echo "Usage:"
- echo " $CMDNAME [options] [dbname]"
+ echo " $CMDNAME [OPTION]... [DBNAME]"
echo
echo "Options:"
- echo " -h, --host=HOSTNAME Database server host"
- echo " -p, --port=PORT Database server port"
- echo " -U, --username=USERNAME Username to connect as"
- echo " -W, --password Prompt for password"
- echo " -d, --dbname=DBNAME Database to cluster"
- echo " -a, --all Cluster all databases"
- echo " -t, --table='TABLE' Cluster specific table only"
- echo " -v, --verbose Write a lot of output"
- echo " -e, --echo Show the command being sent to the backend"
- echo " -q, --quiet Don't write any output"
+ echo " -a, --all cluster all databases"
+ echo " -d, --dbname=DBNAME database to cluster"
+ echo " -t, --table='TABLE' cluster specific table only"
+ echo " -e, --echo show the command being sent to the backend"
+ echo " -q, --quiet don't write any output"
+ echo " -v, --verbose write a lot of output"
+ echo " --help show this help, then exit"
+ echo
+ echo "Connection options:"
+ echo " -h, --host=HOSTNAME database server host"
+ echo " -p, --port=PORT database server port"
+ echo " -U, --username=USERNAME user name to connect as"
+ echo " -W, --password prompt for password"
echo
echo "Read the description of the SQL command CLUSTER for details."
echo
diff --git a/src/bin/scripts/createdb b/src/bin/scripts/createdb
index bfba8e1a1e..d6fa8c1b53 100644
--- a/src/bin/scripts/createdb
+++ b/src/bin/scripts/createdb
@@ -134,19 +134,22 @@ if [ "$usage" ]; then
echo "$CMDNAME creates a PostgreSQL database."
echo
echo "Usage:"
- echo " $CMDNAME [options] [dbname] [description]"
+ echo " $CMDNAME [OPTION]... [DBNAME] [DESCRIPTION]"
echo
echo "Options:"
- echo " -O, --owner=OWNER Database user to own the new database"
- echo " -D, --location=PATH Alternative place to store the database"
- echo " -T, --template=TEMPLATE Template database to copy"
- echo " -E, --encoding=ENCODING Encoding for the database"
- echo " -h, --host=HOSTNAME Database server host"
- echo " -p, --port=PORT Database server port"
- echo " -U, --username=USERNAME Username to connect as"
- echo " -W, --password Prompt for password"
- echo " -e, --echo Show the query being sent to the backend"
- echo " -q, --quiet Don't write any messages"
+ echo " -D, --location=PATH alternative place to store the database"
+ echo " -E, --encoding=ENCODING encoding for the database"
+ echo " -O, --owner=OWNER database user to own the new database"
+ echo " -T, --template=TEMPLATE template database to copy"
+ echo " -e, --echo show the query being sent to the backend"
+ echo " -q, --quiet don't write any messages"
+ echo " --help show this help, then exit"
+ echo
+ echo "Connection options:"
+ echo " -h, --host=HOSTNAME database server host"
+ echo " -p, --port=PORT database server port"
+ echo " -U, --username=USERNAME user name to connect as"
+ echo " -W, --password prompt for password"
echo
echo "By default, a database with the same name as the current user is created."
echo
diff --git a/src/bin/scripts/createlang.sh b/src/bin/scripts/createlang.sh
index fa43bafb48..740740b0d7 100644
--- a/src/bin/scripts/createlang.sh
+++ b/src/bin/scripts/createlang.sh
@@ -130,16 +130,17 @@ if [ -n "$usage" ]; then
echo "$CMDNAME installs a procedural language into a PostgreSQL database."
echo
echo "Usage:"
- echo " $CMDNAME [options] langname [dbname]"
+ echo " $CMDNAME [OPTION]... LANGNAME [DBNAME]"
echo
echo "Options:"
- echo " -h, --host=HOSTNAME Database server host"
- echo " -p, --port=PORT Database server port"
- echo " -U, --username=USERNAME Username to connect as"
- echo " -W, --password Prompt for password"
- echo " -d, --dbname=DBNAME Database to install language in"
- echo " -L, --pglib=DIRECTORY Find language interpreter file in DIRECTORY"
- echo " -l, --list Show a list of currently installed languages"
+ echo " -d, --dbname=DBNAME database to install language in"
+ echo " -l, --list show a list of currently installed languages"
+ echo " -L, --pglib=DIRECTORY find language interpreter file in DIRECTORY"
+ echo " -h, --host=HOSTNAME database server host"
+ echo " -p, --port=PORT database server port"
+ echo " -U, --username=USERNAME user name to connect as"
+ echo " -W, --password prompt for password"
+ echo " --help show this help, then exit"
echo
echo "Report bugs to <[email protected]>."
exit 0
diff --git a/src/bin/scripts/createuser b/src/bin/scripts/createuser
index d4620509d3..0ac8cadc94 100644
--- a/src/bin/scripts/createuser
+++ b/src/bin/scripts/createuser
@@ -141,25 +141,28 @@ if [ "$usage" ]; then
echo "$CMDNAME creates a new PostgreSQL user."
echo
echo "Usage:"
- echo " $CMDNAME [options] [username]"
+ echo " $CMDNAME [OPTION]... [USERNAME]"
echo
echo "Options:"
- echo " -d, --createdb User can create new databases"
- echo " -D, --no-createdb User cannot create databases"
- echo " -a, --adduser User can add new users"
- echo " -A, --no-adduser User cannot add new users"
- echo " -i, --sysid=SYSID Select sysid for new user"
- echo " -P, --pwprompt Assign a password to new user"
- echo " -E, --encrypted Encrypt stored password"
- echo " -N, --unencrypted Do no encrypt stored password"
- echo " -h, --host=HOSTNAME Database server host"
- echo " -p, --port=PORT Database server port"
- echo " -U, --username=USERNAME Username to connect as (not the one to create)"
- echo " -W, --password Prompt for password to connect"
- echo " -e, --echo Show the query being sent to the backend"
- echo " -q, --quiet Don't write any messages"
+ echo " -a, --adduser user can add new users"
+ echo " -A, --no-adduser user cannot add new users"
+ echo " -d, --createdb user can create new databases"
+ echo " -D, --no-createdb user cannot create databases"
+ echo " -P, --pwprompt assign a password to new user"
+ echo " -E, --encrypted encrypt stored password"
+ echo " -N, --unencrypted do no encrypt stored password"
+ echo " -i, --sysid=SYSID select sysid for new user"
+ echo " -e, --echo show the query being sent to the backend"
+ echo " -q, --quiet don't write any messages"
+ echo " --help show this help, then exit"
echo
- echo "If one of -d, -D, -a, -A, and 'username' is not specified, you will"
+ echo "Connection options:"
+ echo " -h, --host=HOSTNAME database server host"
+ echo " -p, --port=PORT database server port"
+ echo " -U, --username=USERNAME user name to connect as (not the one to create)"
+ echo " -W, --password prompt for password to connect"
+ echo
+ echo "If one of -a, -A, -d, -D, and USERNAME is not specified, you will"
echo "be prompted interactively."
echo
echo "Report bugs to <[email protected]>."
diff --git a/src/bin/scripts/dropdb b/src/bin/scripts/dropdb
index 153797275c..e7ad2b95c9 100644
--- a/src/bin/scripts/dropdb
+++ b/src/bin/scripts/dropdb
@@ -104,16 +104,17 @@ if [ "$usage" ]; then
echo "$CMDNAME removes a PostgreSQL database."
echo
echo "Usage:"
- echo " $CMDNAME [options] dbname"
+ echo " $CMDNAME [OPTION]... DBNAME"
echo
echo "Options:"
- echo " -h, --host=HOSTNAME Database server host"
- echo " -p, --port=PORT Database server port"
- echo " -U, --username=USERNAME Username to connect as"
- echo " -W, --password Prompt for password"
- echo " -i, --interactive Prompt before deleting anything"
- echo " -e, --echo Show the query being sent to the backend"
- echo " -q, --quiet Don't write any messages"
+ echo " -e, --echo show the query being sent to the backend"
+ echo " -i, --interactive prompt before deleting anything"
+ echo " -q, --quiet don't write any messages"
+ echo " -h, --host=HOSTNAME database server host"
+ echo " -p, --port=PORT database server port"
+ echo " -U, --username=USERNAME user name to connect as"
+ echo " -W, --password prompt for password"
+ echo " --help show this help, then exit"
echo
echo "Report bugs to <[email protected]>."
exit 0
diff --git a/src/bin/scripts/droplang b/src/bin/scripts/droplang
index e0c297d442..642032e56a 100644
--- a/src/bin/scripts/droplang
+++ b/src/bin/scripts/droplang
@@ -120,15 +120,16 @@ if [ "$usage" ]; then
echo "$CMDNAME removes a procedural language from a database."
echo
echo "Usage:"
- echo " $CMDNAME [options] langname [dbname]"
+ echo " $CMDNAME [OPTION]... LANGNAME [DBNAME]"
echo
echo "Options:"
- echo " -h, --host=HOSTNAME Database server host"
- echo " -p, --port=PORT Database server port"
- echo " -U, --username=USERNAME Username to connect as"
- echo " -W, --password Prompt for password"
- echo " -d, --dbname=DBNAME Database to remove language from"
- echo " -l, --list Show a list of currently installed languages"
+ echo " -d, --dbname=DBNAME database to remove language from"
+ echo " -l, --list show a list of currently installed languages"
+ echo " -h, --host=HOSTNAME database server host"
+ echo " -p, --port=PORT database server port"
+ echo " -U, --username=USERNAME user name to connect as"
+ echo " -W, --password prompt for password"
+ echo " --help show this help, then exit"
echo
echo "Report bugs to <[email protected]>."
exit 0
diff --git a/src/bin/scripts/dropuser b/src/bin/scripts/dropuser
index 308dbd6c49..eb6b5ff471 100644
--- a/src/bin/scripts/dropuser
+++ b/src/bin/scripts/dropuser
@@ -110,16 +110,17 @@ if [ "$usage" ]; then
echo "$CMDNAME removes a PostgreSQL user."
echo
echo "Usage:"
- echo " $CMDNAME [options] [username]"
+ echo " $CMDNAME [OPTION]... [USERNAME]"
echo
echo "Options:"
- echo " -h, --host=HOSTNAME Database server host"
- echo " -p, --port=PORT Database server port"
- echo " -U, --username=USERNAME Username to connect as (not the one to drop)"
- echo " -W, --password Prompt for password to connect"
- echo " -i, --interactive Prompt before deleting anything"
- echo " -e, --echo Show the query being sent to the backend"
- echo " -q, --quiet Don't write any messages"
+ echo " -e, --echo show the query being sent to the backend"
+ echo " -i, --interactive prompt before deleting anything"
+ echo " -q, --quiet don't write any messages"
+ echo " -h, --host=HOSTNAME database server host"
+ echo " -p, --port=PORT database server port"
+ echo " -U, --username=USERNAME user name to connect as (not the one to drop)"
+ echo " -W, --password prompt for password to connect"
+ echo " --help show this help, then exit"
echo
echo "Report bugs to <[email protected]>."
exit 0
diff --git a/src/bin/scripts/vacuumdb b/src/bin/scripts/vacuumdb
index 1da95339ac..896a5153e2 100644
--- a/src/bin/scripts/vacuumdb
+++ b/src/bin/scripts/vacuumdb
@@ -126,21 +126,24 @@ if [ "$usage" ]; then
echo "$CMDNAME cleans and analyzes a PostgreSQL database."
echo
echo "Usage:"
- echo " $CMDNAME [options] [dbname]"
+ echo " $CMDNAME [OPTION]... [DBNAME]"
echo
echo "Options:"
- echo " -h, --host=HOSTNAME Database server host"
- echo " -p, --port=PORT Database server port"
- echo " -U, --username=USERNAME Username to connect as"
- echo " -W, --password Prompt for password"
- echo " -d, --dbname=DBNAME Database to vacuum"
- echo " -a, --all Vacuum all databases"
- echo " -t, --table='TABLE[(columns)]' Vacuum specific table only"
- echo " -f, --full Do full vacuuming"
- echo " -v, --verbose Write a lot of output"
- echo " -z, --analyze Update optimizer hints"
- echo " -e, --echo Show the command being sent to the backend"
- echo " -q, --quiet Don't write any output"
+ echo " -a, --all vacuum all databases"
+ echo " -d, --dbname=DBNAME database to vacuum"
+ echo " -t, --table='TABLE[(columns)]' vacuum specific table only"
+ echo " -f, --full do full vacuuming"
+ echo " -z, --analyze update optimizer hints"
+ echo " -e, --echo show the command being sent to the backend"
+ echo " -q, --quiet don't write any output"
+ echo " -v, --verbose write a lot of output"
+ echo " --help show this help, then exit"
+ echo
+ echo "Connection options:"
+ echo " -h, --host=HOSTNAME database server host"
+ echo " -p, --port=PORT database server port"
+ echo " -U, --username=USERNAME user name to connect as"
+ echo " -W, --password prompt for password"
echo
echo "Read the description of the SQL command VACUUM for details."
echo
diff --git a/src/interfaces/ecpg/preproc/ecpg.c b/src/interfaces/ecpg/preproc/ecpg.c
index 6ac301bd8d..9ca8dc1f97 100644
--- a/src/interfaces/ecpg/preproc/ecpg.c
+++ b/src/interfaces/ecpg/preproc/ecpg.c
@@ -29,27 +29,23 @@ help(const char *progname)
{
printf("%s is the PostgreSQL embedded SQL preprocessor for C programs.\n\n",
progname);
- /* printf is a macro some places; don't #ifdef inside its arguments */
-#ifdef YYDEBUG
printf("Usage:\n"
- " %s [-d] [-I DIRECTORY] [-o OUTFILE] [-t] [-c] [-D symbol] file1 [file2...]\n\n",
+ " %s [OPTION]... FILE...\n\n",
progname);
-#else
- printf("Usage:\n"
- " %s [-I DIRECTORY] [-o OUTFILE] [-t] [-c] [-D symbol] file1 [file2...]\n\n",
- progname);
-#endif
printf("Options:\n");
+ printf(" -c automatically generate C code from embedded SQL code;\n"
+ " currently this works for EXEC SQL TYPE\n");
#ifdef YYDEBUG
- printf(" -d generate parser debug output\n");
+ printf(" -d generate parser debug output\n");
#endif
- printf(" -I DIRECTORY search DIRECTORY for include files\n");
- printf(" -o OUTFILE write result to OUTFILE\n");
- printf(" -t turn on autocommit of transactions\n");
- printf(" -c automatically generate C code from embedded SQL code\n currently this works for EXEC SQL TYPE\n");
- printf(" -D symbol define symbo\n");
- printf("\nIf no output file is specified, the name is formed by adding .c\n"
- "to the input file name, after stripping off .pgc if present.\n");
+ printf(" -D SYMBOL define SYMBOL\n");
+ printf(" -I DIRECTORY search DIRECTORY for include files\n");
+ printf(" -o OUTFILE write result to OUTFILE\n");
+ printf(" -t turn on autocommit of transactions\n");
+ printf(" --help show this help, then exit\n");
+ printf(" --version output version information, then exit\n");
+ printf("\nIf no output file is specified, the name is formed by adding .c to the\n"
+ "input file name, after stripping off .pgc if present.\n");
printf("\nReport bugs to <[email protected]>.\n");
}