Thread: patch src/bin/psql/help.c

patch src/bin/psql/help.c

From
alex avriette
Date:
Per the discussion earlier re: sockets and psql


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@avriette.com
Attachment

Re: patch src/bin/psql/help.c

From
Peter Eisentraut
Date:
alex avriette writes:

> Per the discussion earlier re: sockets and psql

It would be clearer if you list the environment variables in a separate
list below the options, not in the middle of the options without
explanation.  It seems, though, that if you list them in psql, you need to
list them everywhere they apply, and that might get a little verbose.

However, the name of the environment variable is PGUSER, not $PGUSER.

-- 
Peter Eisentraut   peter_e@gmx.net



Re: patch src/bin/psql/help.c

From
alex avriette
Date:
>> Per the discussion earlier re: sockets and psql
>
> It would be clearer if you list the environment variables in a separate
> list below the options, not in the middle of the options without
> explanation.  It seems, though, that if you list them in psql, you 
> need to
> list them everywhere they apply, and that might get a little verbose.

Yeah. I would be happy to wander through and add a quick blurb about 
the environment variables to the rest of the bin/ tree. However, I 
think you're right, that it is a little too verbose. I couldn't come up 
with a better way to phrase it. I suppose it might be better to leave 
it out. My original aim was to make sure that the --help output 
included the use of a directory for -h.

Hm. Alternatively, something like mpg123's --longhelp comes to mind. 
Does anyone else see a need for something like that?

> However, the name of the environment variable is PGUSER, not $PGUSER.

Against my better judgment, I'll bite. 'Scuze me?

Alex



Re: patch src/bin/psql/help.c

From
Peter Eisentraut
Date:
alex avriette writes:

> My original aim was to make sure that the --help output included the use
> of a directory for -h.

Hmm, what does that have to do with the environment variables?

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".

-- 
Peter Eisentraut   peter_e@gmx.net



Re: patch src/bin/psql/help.c

From
alex avriette
Date:
> Hmm, what does that have to do with the environment variables?

Oh, well, after I read the man page, I realized that it explicitly 
states that PGHOST is either the socket directory or host. I figured 
specifying which options could be fed environment variables was useful. 
It was to me.

> 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 think I'll do that.

Alex