Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8606dd8

Browse files
committed
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.
1 parent b04ce52 commit 8606dd8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/bin/psql/help.c

+7-5
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,6 @@ slashUsage(unsigned short int pager)
164164
char *currdb;
165165

166166
currdb = PQdb(pset.db);
167-
if (currdb == NULL)
168-
currdb = _("none");
169167

170168
output = PageOutput(94, pager);
171169

@@ -257,9 +255,13 @@ slashUsage(unsigned short int pager)
257255
fprintf(output, "\n");
258256

259257
fprintf(output, _("Connection\n"));
260-
fprintf(output, _(" \\c[onnect] [DBNAME|- USER|- HOST|- PORT|-]\n"
261-
" connect to new database (currently \"%s\")\n"),
262-
currdb);
258+
if (currdb)
259+
fprintf(output, _(" \\c[onnect] [DBNAME|- USER|- HOST|- PORT|-]\n"
260+
" connect to new database (currently \"%s\")\n"),
261+
currdb);
262+
else
263+
fprintf(output, _(" \\c[onnect] [DBNAME|- USER|- HOST|- PORT|-]\n"
264+
" connect to new database (currently no connection)\n")),
263265
fprintf(output, _(" \\encoding [ENCODING] show or set client encoding\n"));
264266
fprintf(output, _(" \\password [USERNAME] securely change the password for a user\n"));
265267
fprintf(output, _(" \\conninfo display information about current connection\n"));

0 commit comments

Comments
 (0)