Skip to content

Commit b6f0ad4

Browse files
committed
Have psql command 'help' suggest the use of \?, updated version.
Greg Sabino Mullane
1 parent dc565af commit b6f0ad4

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/bin/psql/help.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2008, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/help.c,v 1.125 2008/04/04 17:42:43 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/help.c,v 1.126 2008/04/04 18:00:25 momjian Exp $
77
*/
88
#include "postgres_fe.h"
99

@@ -188,7 +188,6 @@ slashUsage(unsigned short int pager)
188188
ON(pset.timing));
189189
fprintf(output, _(" \\unset NAME unset (delete) internal variable\n"));
190190
fprintf(output, _(" \\! [COMMAND] execute command in shell or start interactive shell\n"));
191-
fprintf(output, _(" \\? display this help output\n"));
192191
fprintf(output, "\n");
193192

194193
fprintf(output, _("Query Buffer\n"));

src/bin/psql/mainloop.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33
*
44
* Copyright (c) 2000-2008, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/mainloop.c,v 1.88 2008/04/04 17:42:43 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/mainloop.c,v 1.89 2008/04/04 18:00:25 momjian Exp $
77
*/
88
#include "postgres_fe.h"
99
#include "mainloop.h"
1010

1111

1212
#include "command.h"
1313
#include "common.h"
14-
#include "help.h"
1514
#include "input.h"
1615
#include "settings.h"
1716

@@ -172,13 +171,16 @@ MainLoop(FILE *source)
172171
continue;
173172
}
174173

175-
/* A request for help? Be friendly and show them the slash way of doing things */
174+
/* A request for help? Be friendly and give them some guidance */
176175
if (pset.cur_cmd_interactive && query_buf->len == 0 &&
177176
pg_strncasecmp(line, "help", 4) == 0 &&
178177
(line[4] == '\0' || line[4] == ';' || isspace(line[4])))
179178
{
180179
free(line);
181-
slashUsage(pset.popt.topt.pager);
180+
puts("You are using psql, the command-line interface to PostgreSQL.");
181+
puts("Enter SQL commands, or type \\? for a list of backslash options.");
182+
puts("Use \\h for SQL command help.");
183+
puts("Use \\q to quit.");
182184
continue;
183185
}
184186

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy