Re: Long options for psql in 7.1.3 - Mailing list pgsql-bugs

From John Summerfield
Subject Re: Long options for psql in 7.1.3
Date
Msg-id Pine.LNX.4.33.0110060753080.2032-100000@dugite.os2.ami.com.au
Whole thread Raw
In response to Re: Long options for psql in 7.1.3  (Arcady Genkin <a.genkin@utoronto.ca>)
List pgsql-bugs
On 4 Oct 2001, Arcady Genkin wrote:


> Peter Eisentraut <peter_e@gmx.net> writes:
>
> > >   g9genarc@eddie:~$ psql -h /var/pgsql --help
> > >   psql was compiled without support for long options.
> > >   Use --help for help on invocation options.
> > >
> > > I guess that it was confused by having both options at once, since
> > > "psql --help" works fine (i.e. the long options *do* work).
> >
> > While this message is confusing, it's factually correct. ;-)
> Yes, confusing it is.
>
> [...]
> > So --help was the next best (or even better IMHO) choice, and to support
> > it on all installations we had to give it some special treatment.
>
> That's fine, but IMO "psql -h /var/pgsql --help" and "psql --help"
> should either both work, or both not work.  Of course, this is not a
> huge issue, but it did make me rub my eyes (to make sure I wasn't
> seeing a ghost) the first time I've encountered it. :)
>

On a related matter, psql --help doesn't display the long forms even though they're evidently enabled:

[pgtest@numbat pgtest]$ psql --help
This is psql, the PostgreSQL interactive terminal.

Usage:
  psql [options] [dbname [username]]

Options:
  -a              Echo all input from script
  -A              Unaligned table output mode (-P format=unaligned)
  -c COMMAND      Run only single command (SQL or internal) and exit
  -d DBNAME       Specify database name to connect to (default: pgtest)
  -e              Echo commands sent to server
  -E              Display queries that internal commands generate
  -f FILENAME     Execute commands from file, then exit
  -F STRING       Set field separator (default: "|") (-P fieldsep=)
  -h HOSTNAME     Specify database server host (default: local socket)
  -H              HTML table output mode (-P format=html)
  -l              List available databases, then exit
  -n              Disable enhanced command line editing (readline)
  -o FILENAME     Send query results to file (or |pipe)
  -p PORT         Specify database server port (default: 5433)
  -P VAR[=ARG]    Set printing option 'VAR' to 'ARG' (see \pset command)
  -q              Run quietly (no messages, only query output)
  -R STRING       Set record separator (default: newline) (-P recordsep=)
  -s              Single step mode (confirm each query)
  -S              Single line mode (end of line terminates SQL command)
  -t              Print rows only (-P tuples_only)
  -T TEXT         Set HTML table tag attributes (width, border) (-P tableattr=)
  -U NAME         Specify database user name (default: pgtest)
  -v NAME=VALUE   Set psql variable 'NAME' to 'VALUE'
  -V              Show version information and exit
  -W              Prompt for password (should happen automatically)
  -x              Turn on expanded table output (-P expanded)
  -X              Do not read startup file (~/.psqlrc)

For more information, type "\?" (for internal commands) or "\help"
(for SQL commands) from within psql, or consult the psql section in
the PostgreSQL documentation.

Report bugs to <pgsql-bugs@postgresql.org>.
[pgtest@numbat pgtest]$ psql --host
psql: option `--host' requires an argument
Try 'psql --help' for more information.
[pgtest@numbat pgtest]$ psql --version
psql (PostgreSQL) 7.2devel
contains support for: readline, history
Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
Portions Copyright (c) 1996, Regents of the University of California
Read the file COPYRIGHT or use the command \copyright to see the
usage and distribution terms.
[pgtest@numbat pgtest]$

pgsql-bugs by date:

Previous
From: Andreas Wernitznig
Date:
Subject: Re: Bug #474: Index using problem
Next
From: John Summerfield
Date:
Subject: Problem building from CVS