Re: [HACKERS] patch src/bin/psql/help.c

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: alex avriette <alex(at)posixnap(dot)net>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] patch src/bin/psql/help.c
Date: 2003-06-11 05:14:12
Message-ID: 200306110514.h5B5ECi19578@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


Here is an applied patch that adds a mention that client -h can accept
socket directory names too.

---------------------------------------------------------------------------

alex avriette wrote:
>
> > I just posted this patch and will apply shortly. Not sure about
> > displaying defaults --- that could get large.
>
> You rock, Bruce. Thanks.
>
> Yeah. That's why I mentioned the --longhelp option mpg123 has. However,
> as nobody was interested in even a "little verbosity," I doubt anyone's
> going to lose sleep over a page full of verbosity. Typically, I always
> issue a binaryname --help before reading the manpage. If it offered me
> a --longhelp at the end of --help, I'd hit that up before the manpage
> as well.
>
> But ymmv.
>
> Thank you again.
>
> Alex
>
> >
> > -----------------------------------------------------------------------
> > ----
> >
> > alex avriette wrote:
> >>
> >>> I assume you decided against continuing with this.
> >>
> >> Hi, Bruce.
> >>
> >> Ack! I just got so caught up with work, I forgot all the little things
> >> I was working on. I still would like to see it mentioned in the
> >> documentation, but I don't have the time right now to do it.
> >> Additionally, I felt somewhat stymied by the lack of interest in it. I
> >> mean, I answered my question, seems to me that if nobody else has
> >> asked
> >> the question, it mightn't be necessary to patch the documentation or
> >> help.
> >>
> >> Eventually Peter and I came to this:
> >>
> >>> To serve your end, I suppose you could go through the help outputs
> >>> and
> >>> replace "database server host" by "database server host or socket
> >>> directory".
> >>
> >> I could probably do this with a grep through the source, but adding
> >> three words is something anyone could do.
> >>
> >> What's your feeling on the subject, Bruce?
> >>
> >> Alex
> >>
> >>>
> >>> ---------------------------------------------------------------------
> >>> --
> >>> ----
> >>>
> >>> alex avriette wrote:
> >>>> Per the discussion earlier re: sockets and psql
> >>>
> >>> [ Attachment, skipping... ]
> >>>
> >>>>
> >>>>
> >>>> Synopsis: psql --help now returns:
> >>>>
> >>>> [ snip ]
> >>>>
> >>>> Connection options:
> >>>> -h [ HOSTNAME | DIR ] specify database server host or location
> >>>> of
> >>>> socket ($PGHOST, default: local socket)
> >>>> -p PORT specify database server port ($PGPORT,
> >>>> default: 5432)
> >>>> -U NAME specify database user name ($PGUSER,
> >>>> default: root)
> >>>> -W prompt for password (should happen
> >>>> automatically)
> >>>>
> >>>> Nobody complained when I asked if it was too verbose, and I think it
> >>>> contributes to the helpfulness of the help. Additionally, the
> >>>> psql(1)
> >>>> page and the psql-ref.sgml document already explain this behaviour.
> >>>>
> >>>> I spoke with Dennis Bjorklund about this on IRC, he suggested that
> >>>> this
> >>>> was easier for the translators, and is in the same style as
> >>>> pg_dump.c
> >>>> (why is there no src/bin/pg_dump/help.c?).
> >>>>
> >>>> thanks,
> >>>> alex
> >>>>
> >>>> --
> >>>> alex avriette, unix geek for hire
> >>>> http://envy.posixnap.net/
> >>>> alex(at)avriette(dot)com
> >>>
> >>>>
> >>>> ---------------------------(end of
> >>>> broadcast)---------------------------
> >>>> TIP 5: Have you checked our extensive FAQ?
> >>>>
> >>>> http://www.postgresql.org/docs/faqs/FAQ.html
> >>>
> >>> --
> >>> Bruce Momjian | http://candle.pha.pa.us
> >>> pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
> >>> + If your life is a hard drive, | 13 Roberts Road
> >>> + Christ can be your backup. | Newtown Square,
> >>> Pennsylvania
> >>> 19073
> >>>
> >>>
> >>
> >> --
> >> alex avriette - alex(at)avriette(dot)com
> >> unix systems gladiator
> >> http://envy.posixnap.net/
> >>
> >>
> >
> > --
> > Bruce Momjian | http://candle.pha.pa.us
> > pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
> > + If your life is a hard drive, | 13 Roberts Road
> > + Christ can be your backup. | Newtown Square, Pennsylvania
> > 19073
> > Index: src/bin/pg_dump/pg_dump.c
> > ===================================================================
> > RCS file: /cvsroot/pgsql-server/src/bin/pg_dump/pg_dump.c,v
> > retrieving revision 1.331
> > diff -c -c -r1.331 pg_dump.c
> > *** src/bin/pg_dump/pg_dump.c 30 May 2003 22:55:15 -0000 1.331
> > --- src/bin/pg_dump/pg_dump.c 2 Jun 2003 15:03:41 -0000
> > ***************
> > *** 694,700 ****
> > " disable triggers during data-only
> > restore\n"));
> >
> > printf(_("\nConnection options:\n"));
> > ! 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"));
> > --- 694,700 ----
> > " disable triggers during data-only
> > restore\n"));
> >
> > printf(_("\nConnection options:\n"));
> > ! printf(_(" -h, --host=HOSTNAME database server host or socket
> > directory\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"));
> > Index: src/bin/pg_dump/pg_dumpall.c
> > ===================================================================
> > RCS file: /cvsroot/pgsql-server/src/bin/pg_dump/pg_dumpall.c,v
> > retrieving revision 1.20
> > diff -c -c -r1.20 pg_dumpall.c
> > *** src/bin/pg_dump/pg_dumpall.c 30 May 2003 23:55:10 -0000 1.20
> > --- src/bin/pg_dump/pg_dumpall.c 2 Jun 2003 15:03:42 -0000
> > ***************
> > *** 253,259 ****
> > printf(_(" --version output version information,
> > then exit\n"));
> >
> > printf(_("\nConnection options:\n"));
> > ! 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"));
> > --- 253,259 ----
> > printf(_(" --version output version information,
> > then exit\n"));
> >
> > printf(_("\nConnection options:\n"));
> > ! printf(_(" -h, --host=HOSTNAME database server host or socket
> > directory\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"));
> > Index: src/bin/pg_dump/pg_restore.c
> > ===================================================================
> > RCS file: /cvsroot/pgsql-server/src/bin/pg_dump/pg_restore.c,v
> > retrieving revision 1.45
> > diff -c -c -r1.45 pg_restore.c
> > *** src/bin/pg_dump/pg_restore.c 4 Apr 2003 20:42:13 -0000 1.45
> > --- src/bin/pg_dump/pg_restore.c 2 Jun 2003 15:03:42 -0000
> > ***************
> > *** 409,415 ****
> > " disable triggers during data-only
> > restore\n"));
> >
> > printf(_("\nConnection options:\n"));
> > ! 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"));
> > --- 409,415 ----
> > " disable triggers during data-only
> > restore\n"));
> >
> > printf(_("\nConnection options:\n"));
> > ! printf(_(" -h, --host=HOSTNAME database server host or socket
> > directory\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"));
> > Index: src/bin/psql/help.c
> > ===================================================================
> > RCS file: /cvsroot/pgsql-server/src/bin/psql/help.c,v
> > retrieving revision 1.72
> > diff -c -c -r1.72 help.c
> > *** src/bin/psql/help.c 14 Apr 2003 16:23:36 -0000 1.72
> > --- src/bin/psql/help.c 2 Jun 2003 15:03:43 -0000
> > ***************
> > *** 123,129 ****
> > puts(_("\nConnection options:"));
> > /* Display default host */
> > env = getenv("PGHOST");
> > ! printf(_(" -h HOSTNAME specify database server host (default:
> > %s)\n"),
> > env ? env : _("local socket"));
> > /* Display default port */
> > env = getenv("PGPORT");
> > --- 123,129 ----
> > puts(_("\nConnection options:"));
> > /* Display default host */
> > env = getenv("PGHOST");
> > ! printf(_(" -h HOSTNAME specify database server host or socket
> > directory (default: %s)\n"),
> > env ? env : _("local socket"));
> > /* Display default port */
> > env = getenv("PGPORT");
> > Index: src/bin/scripts/clusterdb
> > ===================================================================
> > RCS file: /cvsroot/pgsql-server/src/bin/scripts/clusterdb,v
> > retrieving revision 1.11
> > diff -c -c -r1.11 clusterdb
> > *** src/bin/scripts/clusterdb 14 May 2003 03:26:03 -0000 1.11
> > --- src/bin/scripts/clusterdb 2 Jun 2003 15:03:43 -0000
> > ***************
> > *** 123,129 ****
> > 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"
> > --- 123,129 ----
> > echo " --help show this help, then exit"
> > echo
> > echo "Connection options:"
> > ! echo " -h, --host=HOSTNAME database server host or socket
> > directory"
> > echo " -p, --port=PORT database server port"
> > echo " -U, --username=USERNAME user name to connect as"
> > echo " -W, --password prompt for password"
> > Index: src/bin/scripts/createdb.c
> > ===================================================================
> > RCS file: /cvsroot/pgsql-server/src/bin/scripts/createdb.c,v
> > retrieving revision 1.2
> > diff -c -c -r1.2 createdb.c
> > *** src/bin/scripts/createdb.c 14 May 2003 03:26:03 -0000 1.2
> > --- src/bin/scripts/createdb.c 2 Jun 2003 15:03:43 -0000
> > ***************
> > *** 223,229 ****
> > printf(_(" --help show this help, then
> > exit\n"));
> > printf(_(" --version output version information,
> > then exit\n"));
> > printf(_("\nConnection options:\n"));
> > ! printf(_(" -h, --host=HOSTNAME database server host\n"));
> > printf(_(" -p, --port=PORT database server port\n"));
> > printf(_(" -U, --username=USERNAME user name to connect as\n"));
> > printf(_(" -W, --password prompt for password\n"));
> > --- 223,229 ----
> > printf(_(" --help show this help, then
> > exit\n"));
> > printf(_(" --version output version information,
> > then exit\n"));
> > printf(_("\nConnection options:\n"));
> > ! printf(_(" -h, --host=HOSTNAME database server host or
> > socket directory\n"));
> > printf(_(" -p, --port=PORT database server port\n"));
> > printf(_(" -U, --username=USERNAME user name to connect as\n"));
> > printf(_(" -W, --password prompt for password\n"));
> > Index: src/bin/scripts/createlang.c
> > ===================================================================
> > RCS file: /cvsroot/pgsql-server/src/bin/scripts/createlang.c,v
> > retrieving revision 1.2
> > diff -c -c -r1.2 createlang.c
> > *** src/bin/scripts/createlang.c 14 May 2003 03:26:03 -0000 1.2
> > --- src/bin/scripts/createlang.c 2 Jun 2003 15:03:43 -0000
> > ***************
> > *** 276,282 ****
> > printf(_(" -e, --echo show the commands being sent
> > to the server\n"));
> > printf(_(" -l, --list show a list of currently
> > installed languages\n"));
> > printf(_(" -L, --pglib=DIRECTORY find language interpreter
> > file in DIRECTORY\n"));
> > ! printf(_(" -h, --host=HOSTNAME database server host\n"));
> > printf(_(" -p, --port=PORT database server port\n"));
> > printf(_(" -U, --username=USERNAME user name to connect as\n"));
> > printf(_(" -W, --password prompt for password\n"));
> > --- 276,282 ----
> > printf(_(" -e, --echo show the commands being sent
> > to the server\n"));
> > printf(_(" -l, --list show a list of currently
> > installed languages\n"));
> > printf(_(" -L, --pglib=DIRECTORY find language interpreter
> > file in DIRECTORY\n"));
> > ! printf(_(" -h, --host=HOSTNAME database server host or
> > socket directory\n"));
> > printf(_(" -p, --port=PORT database server port\n"));
> > printf(_(" -U, --username=USERNAME user name to connect as\n"));
> > printf(_(" -W, --password prompt for password\n"));
> > Index: src/bin/scripts/createuser.c
> > ===================================================================
> > RCS file: /cvsroot/pgsql-server/src/bin/scripts/createuser.c,v
> > retrieving revision 1.3
> > diff -c -c -r1.3 createuser.c
> > *** src/bin/scripts/createuser.c 27 May 2003 19:36:54 -0000 1.3
> > --- src/bin/scripts/createuser.c 2 Jun 2003 15:03:43 -0000
> > ***************
> > *** 248,254 ****
> > printf(_(" --help show this help, then
> > exit\n"));
> > printf(_(" --version output version information,
> > then exit\n"));
> > printf(_("\nConnection options:\n"));
> > ! printf(_(" -h, --host=HOSTNAME database server host\n"));
> > printf(_(" -p, --port=PORT database server port\n"));
> > printf(_(" -U, --username=USERNAME user name to connect as (not
> > the one to create)\n"));
> > printf(_(" -W, --password prompt for password to
> > connect\n"));
> > --- 248,254 ----
> > printf(_(" --help show this help, then
> > exit\n"));
> > printf(_(" --version output version information,
> > then exit\n"));
> > printf(_("\nConnection options:\n"));
> > ! printf(_(" -h, --host=HOSTNAME database server host or
> > socket directory\n"));
> > printf(_(" -p, --port=PORT database server port\n"));
> > printf(_(" -U, --username=USERNAME user name to connect as (not
> > the one to create)\n"));
> > printf(_(" -W, --password prompt for password to
> > connect\n"));
> > Index: src/bin/scripts/dropdb.c
> > ===================================================================
> > RCS file: /cvsroot/pgsql-server/src/bin/scripts/dropdb.c,v
> > retrieving revision 1.3
> > diff -c -c -r1.3 dropdb.c
> > *** src/bin/scripts/dropdb.c 27 May 2003 19:36:54 -0000 1.3
> > --- src/bin/scripts/dropdb.c 2 Jun 2003 15:03:43 -0000
> > ***************
> > *** 146,152 ****
> > printf(_(" -e, --echo show the commands being sent
> > to the server\n"));
> > printf(_(" -i, --interactive prompt before deleting
> > anything\n"));
> > printf(_(" -q, --quiet don't write any messages\n"));
> > ! printf(_(" -h, --host=HOSTNAME database server host\n"));
> > printf(_(" -p, --port=PORT database server port\n"));
> > printf(_(" -U, --username=USERNAME user name to connect as\n"));
> > printf(_(" -W, --password prompt for password\n"));
> > --- 146,152 ----
> > printf(_(" -e, --echo show the commands being sent
> > to the server\n"));
> > printf(_(" -i, --interactive prompt before deleting
> > anything\n"));
> > printf(_(" -q, --quiet don't write any messages\n"));
> > ! printf(_(" -h, --host=HOSTNAME database server host or
> > socket directory\n"));
> > printf(_(" -p, --port=PORT database server port\n"));
> > printf(_(" -U, --username=USERNAME user name to connect as\n"));
> > printf(_(" -W, --password prompt for password\n"));
> > Index: src/bin/scripts/droplang.c
> > ===================================================================
> > RCS file: /cvsroot/pgsql-server/src/bin/scripts/droplang.c,v
> > retrieving revision 1.2
> > diff -c -c -r1.2 droplang.c
> > *** src/bin/scripts/droplang.c 14 May 2003 03:26:03 -0000 1.2
> > --- src/bin/scripts/droplang.c 2 Jun 2003 15:03:43 -0000
> > ***************
> > *** 244,250 ****
> > printf(_(" -d, --dbname=DBNAME database to install language
> > in\n"));
> > printf(_(" -e, --echo show the commands being sent
> > to the server\n"));
> > printf(_(" -l, --list show a list of currently
> > installed languages\n"));
> > ! printf(_(" -h, --host=HOSTNAME database server host\n"));
> > printf(_(" -p, --port=PORT database server port\n"));
> > printf(_(" -U, --username=USERNAME user name to connect as\n"));
> > printf(_(" -W, --password prompt for password\n"));
> > --- 244,250 ----
> > printf(_(" -d, --dbname=DBNAME database to install language
> > in\n"));
> > printf(_(" -e, --echo show the commands being sent
> > to the server\n"));
> > printf(_(" -l, --list show a list of currently
> > installed languages\n"));
> > ! printf(_(" -h, --host=HOSTNAME database server host or
> > socket directory\n"));
> > printf(_(" -p, --port=PORT database server port\n"));
> > printf(_(" -U, --username=USERNAME user name to connect as\n"));
> > printf(_(" -W, --password prompt for password\n"));
> > Index: src/bin/scripts/dropuser.c
> > ===================================================================
> > RCS file: /cvsroot/pgsql-server/src/bin/scripts/dropuser.c,v
> > retrieving revision 1.3
> > diff -c -c -r1.3 dropuser.c
> > *** src/bin/scripts/dropuser.c 27 May 2003 19:36:55 -0000 1.3
> > --- src/bin/scripts/dropuser.c 2 Jun 2003 15:03:43 -0000
> > ***************
> > *** 143,152 ****
> > printf(_("Usage:\n"));
> > printf(_(" %s [OPTION]... [USERNAME]\n"), progname);
> > printf(_("\nOptions:\n"));
> > ! printf(_(" -e, --echo show the commands being
> > sent to the server\n"));
> > printf(_(" -i, --interactive prompt before deleting
> > anything\n"));
> > ! printf(_(" -q, --quiet don't write any
> > messages\n"));
> > ! printf(_(" -h, --host=HOSTNAME database server host\n"));
> > printf(_(" -p, --port=PORT database server port\n"));
> > printf(_(" -U, --username=USERNAME user name to connect as (not
> > the one to drop)\n"));
> > printf(_(" -W, --password prompt for password to
> > connect\n"));
> > --- 143,152 ----
> > printf(_("Usage:\n"));
> > printf(_(" %s [OPTION]... [USERNAME]\n"), progname);
> > printf(_("\nOptions:\n"));
> > ! printf(_(" -e, --echo show the commands being sent
> > to the server\n"));
> > printf(_(" -i, --interactive prompt before deleting
> > anything\n"));
> > ! printf(_(" -q, --quiet don't write any messages\n"));
> > ! printf(_(" -h, --host=HOSTNAME database server host or
> > socket directory\n"));
> > printf(_(" -p, --port=PORT database server port\n"));
> > printf(_(" -U, --username=USERNAME user name to connect as (not
> > the one to drop)\n"));
> > printf(_(" -W, --password prompt for password to
> > connect\n"));
> > Index: src/bin/scripts/vacuumdb
> > ===================================================================
> > RCS file: /cvsroot/pgsql-server/src/bin/scripts/vacuumdb,v
> > retrieving revision 1.27
> > diff -c -c -r1.27 vacuumdb
> > *** src/bin/scripts/vacuumdb 14 May 2003 03:26:03 -0000 1.27
> > --- src/bin/scripts/vacuumdb 2 Jun 2003 15:03:43 -0000
> > ***************
> > *** 140,146 ****
> > 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"
> > --- 140,146 ----
> > echo " --help show this help, then exit"
> > echo
> > echo "Connection options:"
> > ! echo " -h, --host=HOSTNAME database server host or
> > socket directory"
> > echo " -p, --port=PORT database server port"
> > echo " -U, --username=USERNAME user name to connect as"
> > echo " -W, --password prompt for password"
> >
>
> --
> alex avriette - alex(at)avriette(dot)com
> unix systems gladiator
> http://envy.posixnap.net/
>
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Attachment Content-Type Size
unknown_filename text/plain 15.6 KB

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2003-06-11 06:59:49 Re: Adding Rendezvous support to postmaster
Previous Message Bruce Momjian 2003-06-11 05:09:33 Remove lock postgresql.conf variables