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

Commit 4cff161

Browse files
committed
Improve formatting of --help output.
1 parent 0d17ce9 commit 4cff161

File tree

23 files changed

+325
-272
lines changed

23 files changed

+325
-272
lines changed

src/backend/postmaster/postmaster.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*
3838
*
3939
* IDENTIFICATION
40-
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.289 2002/09/26 05:17:00 momjian Exp $
40+
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.290 2002/10/18 22:05:35 petere Exp $
4141
*
4242
* NOTES
4343
*
@@ -846,7 +846,7 @@ static void
846846
usage(const char *progname)
847847
{
848848
printf(gettext("%s is the PostgreSQL server.\n\n"), progname);
849-
printf(gettext("Usage:\n %s [options...]\n\n"), progname);
849+
printf(gettext("Usage:\n %s [OPTION]...\n\n"), progname);
850850
printf(gettext("Options:\n"));
851851
#ifdef USE_ASSERT_CHECKING
852852
printf(gettext(" -A 1|0 enable/disable run-time assert checking\n"));
@@ -867,6 +867,8 @@ usage(const char *progname)
867867
printf(gettext(" -o OPTIONS pass 'OPTIONS' to each backend server\n"));
868868
printf(gettext(" -p PORT port number to listen on (default %d)\n"), DEF_PGPORT);
869869
printf(gettext(" -S silent mode (start in background without logging output)\n"));
870+
printf(gettext(" --help show this help, then exit\n"));
871+
printf(gettext(" --version output version information, then exit\n"));
870872

871873
printf(gettext("\nDeveloper options:\n"));
872874
printf(gettext(" -n do not reinitialize shared memory after abnormal exit\n"));

src/backend/tcop/postgres.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.303 2002/10/14 23:49:20 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.304 2002/10/18 22:05:35 petere Exp $
1212
*
1313
* NOTES
1414
* this is the "main" module of the postgres backend and
@@ -1156,14 +1156,14 @@ usage(char *progname)
11561156
{
11571157
printf("%s is the PostgreSQL stand-alone backend. It is not\nintended to be used by normal users.\n\n", progname);
11581158

1159-
printf("Usage:\n %s [options...] [dbname]\n\n", progname);
1159+
printf("Usage:\n %s [OPTION]... [DBNAME]\n\n", progname);
11601160
printf("Options:\n");
11611161
#ifdef USE_ASSERT_CHECKING
11621162
printf(" -A 1|0 enable/disable run-time assert checking\n");
11631163
#endif
11641164
printf(" -B NBUFFERS number of shared buffers (default %d)\n", DEF_NBUFFERS);
11651165
printf(" -c NAME=VALUE set run-time parameter\n");
1166-
printf(" -d 1-5,0 debugging level (0 is off)\n");
1166+
printf(" -d 0-5 debugging level (0 is off)\n");
11671167
printf(" -D DATADIR database directory\n");
11681168
printf(" -e use European date format\n");
11691169
printf(" -E echo query before execution\n");
@@ -1173,11 +1173,13 @@ usage(char *progname)
11731173
printf(" -P disable system indexes\n");
11741174
printf(" -s show statistics after each query\n");
11751175
printf(" -S SORT-MEM set amount of memory for sorts (in kbytes)\n");
1176-
printf("Developer options:\n");
1177-
printf(" -f [s|i|n|m|h] forbid use of some plan types\n");
1176+
printf(" --help show this help, then exit\n");
1177+
printf(" --version output version information, then exit\n");
1178+
printf("\nDeveloper options:\n");
1179+
printf(" -f s|i|n|m|h forbid use of some plan types\n");
11781180
printf(" -i do not execute queries\n");
11791181
printf(" -O allow system table structure changes\n");
1180-
printf(" -t [pa|pl|ex] show timings after each query\n");
1182+
printf(" -t pa|pl|ex show timings after each query\n");
11811183
printf(" -W NUM wait NUM seconds to allow attach from a debugger\n");
11821184
printf("\nReport bugs to <pgsql-bugs@postgresql.org>.\n");
11831185
}
@@ -1767,7 +1769,7 @@ PostgresMain(int argc, char *argv[], const char *username)
17671769
if (!IsUnderPostmaster)
17681770
{
17691771
puts("\nPOSTGRES backend interactive interface ");
1770-
puts("$Revision: 1.303 $ $Date: 2002/10/14 23:49:20 $\n");
1772+
puts("$Revision: 1.304 $ $Date: 2002/10/18 22:05:35 $\n");
17711773
}
17721774

17731775
/*

src/bin/initdb/initdb.sh

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
2828
# Portions Copyright (c) 1994, Regents of the University of California
2929
#
30-
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.175 2002/09/24 23:14:25 tgl Exp $
30+
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.176 2002/10/18 22:05:35 petere Exp $
3131
#
3232
#-------------------------------------------------------------------------
3333

@@ -335,24 +335,30 @@ if [ "$usage" ]; then
335335
echo "$CMDNAME initializes a PostgreSQL database cluster."
336336
echo
337337
echo "Usage:"
338-
echo " $CMDNAME [options] datadir"
338+
echo " $CMDNAME [OPTION]... [DATADIR]"
339339
echo
340340
echo "Options:"
341-
echo " [-D, --pgdata] DATADIR Location for this database cluster"
342-
echo " -W, --pwprompt Prompt for a password for the new superuser"
343-
echo " -E, --encoding ENCODING Set default encoding for new databases"
344-
echo " --locale LOCALE Initialize database cluster with given locale"
345-
echo " --lc-collate, --lc-ctype, --lc-messages LOCALE"
346-
echo " --lc-monetary, --lc-numeric, --lc-time LOCALE"
347-
echo " Initialize database cluster with given locale"
348-
echo " in the respective category"
349-
echo " (default taken from environment)"
350-
echo " --no-locale Equivalent to --locale=C"
351-
echo " -U, --username NAME Database superuser name"
341+
echo " [-D, --pgdata=]DATADIR location for this database cluster"
342+
echo " -E, --encoding=ENCODING set default encoding for new databases"
343+
echo " --locale=LOCALE initialize database cluster with given locale"
344+
echo " --lc-collate, --lc-ctype, --lc-messages=LOCALE"
345+
echo " --lc-monetary, --lc-numeric, --lc-time=LOCALE"
346+
echo " initialize database cluster with given locale"
347+
echo " in the respective category (default taken from"
348+
echo " environment)"
349+
echo " --no-locale equivalent to --locale=C"
350+
echo " -U, --username=NAME database superuser name"
351+
echo " -W, --pwprompt prompt for a password for the new superuser"
352+
echo " --help show this help, then exit"
353+
echo " --version output version information, then exit"
354+
echo
352355
echo "Less commonly used options: "
353-
echo " -L DIRECTORY Where to find the input files"
354-
echo " -d, --debug Generate lots of debugging output"
355-
echo " -n, --noclean Do not clean up after errors"
356+
echo " -d, --debug generate lots of debugging output"
357+
echo " -L DIRECTORY where to find the input files"
358+
echo " -n, --noclean do not clean up after errors"
359+
echo
360+
echo "If the data directory is not specified, the environment variable PGDATA"
361+
echo "is used."
356362
echo
357363
echo "Report bugs to <pgsql-bugs@postgresql.org>."
358364
exit 0

src/bin/initlocation/initlocation.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#
1010
#
1111
# IDENTIFICATION
12-
# $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/initlocation.sh,v 1.14 2002/06/20 20:29:41 momjian Exp $
12+
# $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/initlocation.sh,v 1.15 2002/10/18 22:05:35 petere Exp $
1313
#
1414
#-------------------------------------------------------------------------
1515

@@ -64,7 +64,8 @@ done
6464

6565

6666
if [ "$usage" ]; then
67-
echo "$CMDNAME initializes an alternative filesystem location for database creation."
67+
echo "$CMDNAME initializes an alternative filesystem location for database"
68+
echo "creation."
6869
echo ""
6970
echo "Usage:"
7071
echo " $CMDNAME LOCATION"

src/bin/ipcclean/ipcclean.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#!/bin/sh
22
#
3-
# $Header: /cvsroot/pgsql/src/bin/ipcclean/Attic/ipcclean.sh,v 1.12 2001/09/30 22:17:50 momjian Exp $
3+
# $Header: /cvsroot/pgsql/src/bin/ipcclean/Attic/ipcclean.sh,v 1.13 2002/10/18 22:05:35 petere Exp $
44
#
55

66
CMDNAME=`basename $0`
77

88
if [ "$1" = '-?' -o "$1" = "--help" ]; then
9-
echo "$CMDNAME cleans up shared memory and semaphores from aborted PostgreSQL backends."
9+
echo "$CMDNAME cleans up shared memory and semaphores from aborted PostgreSQL"
10+
echo "backends."
1011
echo
1112
echo "Usage:"
1213
echo " $CMDNAME"

src/bin/pg_config/pg_config.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Author: Peter Eisentraut <peter_e@gmx.net>
88
# Public domain
99

10-
# $Header: /cvsroot/pgsql/src/bin/pg_config/Attic/pg_config.sh,v 1.6 2001/09/30 22:17:51 momjian Exp $
10+
# $Header: /cvsroot/pgsql/src/bin/pg_config/Attic/pg_config.sh,v 1.7 2002/10/18 22:05:35 petere Exp $
1111

1212
me=`basename $0`
1313

@@ -23,9 +23,10 @@ val_version='@version@'
2323
help="\
2424
$me provides information about the installed version of PostgreSQL.
2525
26-
Usage: $me --bindir | --includedir | --includedir-server | --libdir | --pkglibdir | --configure | --version
26+
Usage:
27+
$me OPTION...
2728
28-
Operation modes:
29+
Options:
2930
--bindir show location of user executables
3031
--includedir show location of C header files of the client
3132
interfaces
@@ -34,7 +35,8 @@ Operation modes:
3435
--pkglibdir show location of dynamically loadable modules
3536
--configure show options given to 'configure' script when
3637
PostgreSQL was built
37-
--version show the PostgreSQL version and exit
38+
--version show the PostgreSQL version, then exit
39+
--help show this help, then exit
3840
3941
Report bugs to <pgsql-bugs@postgresql.org>."
4042

src/bin/pg_controldata/pg_controldata.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* copyright (c) Oliver Elphick <olly@lfix.co.uk>, 2001;
77
* licence: BSD
88
*
9-
* $Header: /cvsroot/pgsql/src/bin/pg_controldata/pg_controldata.c,v 1.6 2002/09/04 20:31:34 momjian Exp $
9+
* $Header: /cvsroot/pgsql/src/bin/pg_controldata/pg_controldata.c,v 1.7 2002/10/18 22:05:35 petere Exp $
1010
*/
1111
#include "postgres.h"
1212

@@ -25,7 +25,7 @@
2525
static void
2626
usage(const char *progname)
2727
{
28-
printf(_("%s displays PostgreSQL database cluster control information.\n"), progname);
28+
printf(_("%s displays PostgreSQL database cluster control information.\n\n"), progname);
2929
printf(_("Usage:\n %s [DATADIR]\n\n"), progname);
3030
printf(_("If not data directory is specified, the environment variable PGDATA\nis used.\n\n"));
3131
printf(_("Report bugs to <pgsql-bugs@postgresql.org>.\n"));

src/bin/pg_ctl/pg_ctl.sh

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#
99
#
1010
# IDENTIFICATION
11-
# $Header: /cvsroot/pgsql/src/bin/pg_ctl/Attic/pg_ctl.sh,v 1.29 2002/08/17 15:12:07 momjian Exp $
11+
# $Header: /cvsroot/pgsql/src/bin/pg_ctl/Attic/pg_ctl.sh,v 1.30 2002/10/18 22:05:35 petere Exp $
1212
#
1313
#-------------------------------------------------------------------------
1414

@@ -26,29 +26,30 @@ Usage:
2626
$CMDNAME status [-D DATADIR]
2727
2828
Common options:
29-
-D DATADIR Location of the database storage area
30-
-s Only print errors, no informational messages
31-
-w Wait until operation completes
32-
-W Do not wait until operation completes
29+
-D DATADIR location of the database storage area
30+
-s only print errors, no informational messages
31+
-w wait until operation completes
32+
-W do not wait until operation completes
33+
--help show this help, then exit
34+
--version output version information, then exit
3335
(The default is to wait for shutdown, but not for start or restart.)
3436
3537
If the -D option is omitted, the environment variable PGDATA is used.
3638
3739
Options for start or restart:
38-
-l FILENAME Write (or append) server log to FILENAME. The
39-
use of this option is highly recommended.
40-
-o OPTIONS Command line options to pass to the postmaster
41-
(PostgreSQL server executable)
42-
-p PATH-TO-POSTMASTER Normally not necessary
40+
-l FILENAME write (or append) server log to FILENAME. The
41+
use of this option is highly recommended.
42+
-o OPTIONS command line options to pass to the postmaster
43+
(PostgreSQL server executable)
44+
-p PATH-TO-POSTMASTER normally not necessary
4345
4446
Options for stop or restart:
45-
-m SHUTDOWN-MODE May be 'smart', 'fast', or 'immediate'
47+
-m SHUTDOWN-MODE may be 'smart', 'fast', or 'immediate'
4648
4749
Shutdown modes are:
48-
smart Quit after all clients have disconnected
49-
fast Quit directly, with proper shutdown
50-
immediate Quit without complete shutdown; will lead
51-
to recovery run on restart
50+
smart quit after all clients have disconnected
51+
fast quit directly, with proper shutdown
52+
immediate quit without complete shutdown; will lead to recovery on restart
5253
5354
Report bugs to <pgsql-bugs@postgresql.org>."
5455

src/bin/pg_dump/pg_dump.c

Lines changed: 37 additions & 26 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.303 2002/10/16 05:46:54 momjian Exp $
25+
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.304 2002/10/18 22:05:35 petere Exp $
2626
*
2727
*-------------------------------------------------------------------------
2828
*/
@@ -656,74 +656,85 @@ help(const char *progname)
656656
{
657657
printf(_("%s dumps a database as a text file or to other formats.\n\n"), progname);
658658
printf(_("Usage:\n"));
659-
printf(_(" %s [OPTIONS] DBNAME\n\n"), progname);
660-
printf(_("Options:\n"));
659+
printf(_(" %s [OPTION]... [DBNAME]\n"), progname);
661660

661+
printf(_("\nGeneral options:\n"));
662+
#ifdef HAVE_GETOPT_LONG
663+
printf(_(" -f, --file=FILENAME output file name\n"));
664+
printf(_(" -F, --format=c|t|p output file format (custom, tar, plain text)\n"));
665+
printf(_(" -i, --ignore-version proceed even when server version mismatches\n"
666+
" pg_dump version\n"));
667+
printf(_(" -v, --verbose verbose mode\n"));
668+
printf(_(" -Z, --compress=0-9 compression level for compressed formats\n"));
669+
#else /* not HAVE_GETOPT_LONG */
670+
printf(_(" -f FILENAME output file name\n"));
671+
printf(_(" -F c|t|p output file format (custom, tar, plain text)\n"));
672+
printf(_(" -i proceed even when server version mismatches\n"
673+
" pg_dump version\n"));
674+
printf(_(" -v verbose mode\n"));
675+
printf(_(" -Z 0-9 compression level for compressed formats\n"));
676+
#endif /* not HAVE_GETOPT_LONG */
677+
printf(_(" --help show this help, then exit\n"));
678+
printf(_(" --version output version information, then exit\n"));
679+
680+
printf(_("\nOptions controlling the output content:\n"));
662681
#ifdef HAVE_GETOPT_LONG
663682
printf(_(" -a, --data-only dump only the data, not the schema\n"));
664683
printf(_(" -b, --blobs include large objects in dump\n"));
665684
printf(_(" -c, --clean clean (drop) schema prior to create\n"));
666685
printf(_(" -C, --create include commands to create database in dump\n"));
667686
printf(_(" -d, --inserts dump data as INSERT, rather than COPY, commands\n"));
668687
printf(_(" -D, --column-inserts dump data as INSERT commands with column names\n"));
669-
printf(_(" -f, --file=FILENAME output file name\n"));
670-
printf(_(" -F, --format {c|t|p} output file format (custom, tar, plain text)\n"));
671-
printf(_(" -h, --host=HOSTNAME database server host name\n"));
672-
printf(_(" -i, --ignore-version proceed even when server version mismatches\n"
673-
" pg_dump version\n"));
674688
printf(_(" -o, --oids include OIDs in dump\n"));
675689
printf(_(" -O, --no-owner do not output \\connect commands in plain\n"
676690
" text format\n"));
677-
printf(_(" -p, --port=PORT database server port number\n"));
678691
printf(_(" -R, --no-reconnect disable ALL reconnections to the database in\n"
679692
" plain text format\n"));
680693
printf(_(" -s, --schema-only dump only the schema, no data\n"));
681694
printf(_(" -S, --superuser=NAME specify the superuser user name to use in\n"
682695
" plain text format\n"));
683696
printf(_(" -t, --table=TABLE dump this table only (* for all)\n"));
684-
printf(_(" -U, --username=NAME connect as specified database user\n"));
685-
printf(_(" -v, --verbose verbose mode\n"));
686-
printf(_(" -W, --password force password prompt (should happen automatically)\n"));
687697
printf(_(" -x, --no-privileges do not dump privileges (grant/revoke)\n"));
688698
printf(_(" -X use-set-session-authorization, --use-set-session-authorization\n"
689699
" output SET SESSION AUTHORIZATION commands rather\n"
690700
" than \\connect commands\n"));
691701
printf(_(" -X disable-triggers, --disable-triggers\n"
692702
" disable triggers during data-only restore\n"));
693-
printf(_(" -Z, --compress {0-9} compression level for compressed formats\n"));
694-
695-
#else /* not HAVE_GETOPT_LONG */
703+
#else /* not HAVE_GETOPT_LONG */
696704
printf(_(" -a dump only the data, not the schema\n"));
697705
printf(_(" -b include large objects in dump\n"));
698706
printf(_(" -c clean (drop) schema prior to create\n"));
699707
printf(_(" -C include commands to create database in dump\n"));
700708
printf(_(" -d dump data as INSERT, rather than COPY, commands\n"));
701709
printf(_(" -D dump data as INSERT commands with column names\n"));
702-
printf(_(" -f FILENAME output file name\n"));
703-
printf(_(" -F {c|t|p} output file format (custom, tar, plain text)\n"));
704-
printf(_(" -h HOSTNAME database server host name\n"));
705-
printf(_(" -i proceed even when server version mismatches\n"
706-
" pg_dump version\n"));
707710
printf(_(" -o include OIDs in dump\n"));
708711
printf(_(" -O do not output \\connect commands in plain\n"
709712
" text format\n"));
710-
printf(_(" -p PORT database server port number\n"));
711713
printf(_(" -R disable ALL reconnections to the database in\n"
712714
" plain text format\n"));
713715
printf(_(" -s dump only the schema, no data\n"));
714716
printf(_(" -S NAME specify the superuser user name to use in\n"
715717
" plain text format\n"));
716718
printf(_(" -t TABLE dump this table only (* for all)\n"));
717-
printf(_(" -U NAME connect as specified database user\n"));
718-
printf(_(" -v verbose mode\n"));
719-
printf(_(" -W force password prompt (should happen automatically)\n"));
720719
printf(_(" -x do not dump privileges (grant/revoke)\n"));
721720
printf(_(" -X use-set-session-authorization\n"
722721
" output SET SESSION AUTHORIZATION commands rather\n"
723722
" than \\connect commands\n"));
724723
printf(_(" -X disable-triggers disable triggers during data-only restore\n"));
725-
printf(_(" -Z {0-9} compression level for compressed formats\n"));
726-
#endif
724+
#endif /* not HAVE_GETOPT_LONG */
725+
726+
printf(_("\nConnection options:\n"));
727+
#ifdef HAVE_GETOPT_LONG
728+
printf(_(" -h, --host=HOSTNAME database server host name\n"));
729+
printf(_(" -p, --port=PORT database server port number\n"));
730+
printf(_(" -U, --username=NAME connect as specified database user\n"));
731+
printf(_(" -W, --password force password prompt (should happen automatically)\n"));
732+
#else /* not HAVE_GETOPT_LONG */
733+
printf(_(" -h HOSTNAME database server host name\n"));
734+
printf(_(" -p PORT database server port number\n"));
735+
printf(_(" -U NAME connect as specified database user\n"));
736+
printf(_(" -W force password prompt (should happen automatically)\n"));
737+
#endif /* not HAVE_GETOPT_LONG */
727738

728739
printf(_("\nIf no database name is not supplied, then the PGDATABASE environment\n"
729740
"variable value is used.\n\n"));

0 commit comments

Comments
 (0)