mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
Make \? help message more clear when not connected.
On second thought, "none" could mislead to think that you're connected a database with that name. Duplicate the whole string, so that it can be more easily translated. In back-branches, thought, just use an empty string in place of the database name, to avoid adding a translatable string.
This commit is contained in:
@ -164,8 +164,6 @@ slashUsage(unsigned short int pager)
|
|||||||
char *currdb;
|
char *currdb;
|
||||||
|
|
||||||
currdb = PQdb(pset.db);
|
currdb = PQdb(pset.db);
|
||||||
if (currdb == NULL)
|
|
||||||
currdb = _("none");
|
|
||||||
|
|
||||||
output = PageOutput(94, pager);
|
output = PageOutput(94, pager);
|
||||||
|
|
||||||
@ -257,9 +255,13 @@ slashUsage(unsigned short int pager)
|
|||||||
fprintf(output, "\n");
|
fprintf(output, "\n");
|
||||||
|
|
||||||
fprintf(output, _("Connection\n"));
|
fprintf(output, _("Connection\n"));
|
||||||
|
if (currdb)
|
||||||
fprintf(output, _(" \\c[onnect] [DBNAME|- USER|- HOST|- PORT|-]\n"
|
fprintf(output, _(" \\c[onnect] [DBNAME|- USER|- HOST|- PORT|-]\n"
|
||||||
" connect to new database (currently \"%s\")\n"),
|
" connect to new database (currently \"%s\")\n"),
|
||||||
currdb);
|
currdb);
|
||||||
|
else
|
||||||
|
fprintf(output, _(" \\c[onnect] [DBNAME|- USER|- HOST|- PORT|-]\n"
|
||||||
|
" connect to new database (currently no connection)\n")),
|
||||||
fprintf(output, _(" \\encoding [ENCODING] show or set client encoding\n"));
|
fprintf(output, _(" \\encoding [ENCODING] show or set client encoding\n"));
|
||||||
fprintf(output, _(" \\password [USERNAME] securely change the password for a user\n"));
|
fprintf(output, _(" \\password [USERNAME] securely change the password for a user\n"));
|
||||||
fprintf(output, _(" \\conninfo display information about current connection\n"));
|
fprintf(output, _(" \\conninfo display information about current connection\n"));
|
||||||
|
Reference in New Issue
Block a user