Monday, June 9, 2008

[PATCHES] Minor pedantry for "help" text

*** a/src/bin/psql/mainloop.c
--- b/src/bin/psql/mainloop.c
***************
*** 177,188 **** MainLoop(FILE *source)
(line[4] == '\0' || line[4] == ';' || isspace((unsigned char) line[4])))
{
free(line);
! puts(_("\nYou are using psql, the command-line interface to PostgreSQL."));
! puts(_("\t\\? for psql help"));
! puts(_("\t\\h or \\help for SQL help\n"));
! puts(_("\t\\g or \";\" to execute a query"));
! puts(_("\t\\q to quit psql\n"));
! puts(_("\t\\copyright to view the copyright\n"));

fflush(stdout);
continue;
--- 177,188 ----
(line[4] == '\0' || line[4] == ';' || isspace((unsigned char) line[4])))
{
free(line);
! puts(_("You are using psql, the command-line interface to PostgreSQL."));
! printf(_("Type: \\copyright for distribution terms\n"
! " \\h for help with SQL commands\n"
! " \\? for help with psql commands\n"
! " \\g or terminate with semicolon to execute query\n"
! " \\q to quit\n"));

fflush(stdout);
continue;
Attached is a patch that makes some minor changes to the text emitted by
the new "help" command. Previous output:

postgres=# help

You are using psql, the command-line interface to PostgreSQL.
\? for psql help
\h or \help for SQL help

\g or ";" to execute a query
\q to quit psql

\copyright to view the copyright

postgres=#

New output:

postgres=# help
You are using psql, the command-line interface to PostgreSQL.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
postgres=#

The newlines in the previous text were inconsistent with psql error
message style elsewhere, aside from being distracting. The advice on
commands to enter next was also just emitted, without actually telling
the user that these are possible inputs. Essentially the text was a
regression from the text we've always used in the startup banner, so I
just re-instituted the old text.

-Neil, doing his best to suppress his aesthetic objection to having
"help" be valid psql input in the first place

No comments: