File tree 2 files changed +14
-2
lines changed
2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 3
3
*
4
4
* Copyright (c) 2000-2008, PostgreSQL Global Development Group
5
5
*
6
- * $PostgreSQL: pgsql/src/bin/psql/help.c,v 1.124 2008/03/29 19:40:12 tgl Exp $
6
+ * $PostgreSQL: pgsql/src/bin/psql/help.c,v 1.125 2008/04/04 17:42:43 momjian Exp $
7
7
*/
8
8
#include "postgres_fe.h"
9
9
@@ -188,6 +188,7 @@ slashUsage(unsigned short int pager)
188
188
ON (pset .timing ));
189
189
fprintf (output , _ (" \\unset NAME unset (delete) internal variable\n" ));
190
190
fprintf (output , _ (" \\! [COMMAND] execute command in shell or start interactive shell\n" ));
191
+ fprintf (output , _ (" \\? display this help output\n" ));
191
192
fprintf (output , "\n" );
192
193
193
194
fprintf (output , _ ("Query Buffer\n" ));
Original file line number Diff line number Diff line change 3
3
*
4
4
* Copyright (c) 2000-2008, PostgreSQL Global Development Group
5
5
*
6
- * $PostgreSQL: pgsql/src/bin/psql/mainloop.c,v 1.87 2008/01/01 19:45:56 momjian Exp $
6
+ * $PostgreSQL: pgsql/src/bin/psql/mainloop.c,v 1.88 2008/04/04 17:42:43 momjian Exp $
7
7
*/
8
8
#include "postgres_fe.h"
9
9
#include "mainloop.h"
10
10
11
11
12
12
#include "command.h"
13
13
#include "common.h"
14
+ #include "help.h"
14
15
#include "input.h"
15
16
#include "settings.h"
16
17
@@ -171,6 +172,16 @@ MainLoop(FILE *source)
171
172
continue ;
172
173
}
173
174
175
+ /* A request for help? Be friendly and show them the slash way of doing things */
176
+ if (pset .cur_cmd_interactive && query_buf -> len == 0 &&
177
+ pg_strncasecmp (line , "help" , 4 ) == 0 &&
178
+ (line [4 ] == '\0' || line [4 ] == ';' || isspace (line [4 ])))
179
+ {
180
+ free (line );
181
+ slashUsage (pset .popt .topt .pager );
182
+ continue ;
183
+ }
184
+
174
185
/* echo back if flag is set */
175
186
if (pset .echo == PSQL_ECHO_ALL && !pset .cur_cmd_interactive )
176
187
puts (line );
You can’t perform that action at this time.
0 commit comments