Skip to content

Commit 719a115

Browse files
committed
Reorgnize psql \? help output, to reduce the size of the "General"
heading at the top; broken into more sections now.
1 parent 210faf2 commit 719a115

File tree

1 file changed

+27
-24
lines changed

1 file changed

+27
-24
lines changed

src/bin/psql/help.c

Lines changed: 27 additions & 24 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.126 2008/04/04 18:00:25 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/help.c,v 1.127 2008/05/14 15:30:22 momjian Exp $
77
*/
88
#include "postgres_fe.h"
99

@@ -160,7 +160,7 @@ slashUsage(unsigned short int pager)
160160
{
161161
FILE *output;
162162

163-
output = PageOutput(69, pager);
163+
output = PageOutput(78, pager);
164164

165165
/* if you add/remove a line here, change the row count above */
166166

@@ -169,25 +169,9 @@ slashUsage(unsigned short int pager)
169169
* in 80 columns >> "
170170
*/
171171
fprintf(output, _("General\n"));
172-
fprintf(output, _(" \\c[onnect] [DBNAME|- USER|- HOST|- PORT|-]\n"
173-
" connect to new database (currently \"%s\")\n"),
174-
PQdb(pset.db));
175-
fprintf(output, _(" \\cd [DIR] change the current working directory\n"));
176172
fprintf(output, _(" \\copyright show PostgreSQL usage and distribution terms\n"));
177-
fprintf(output, _(" \\encoding [ENCODING]\n"
178-
" show or set client encoding\n"));
179173
fprintf(output, _(" \\h [NAME] help on syntax of SQL commands, * for all commands\n"));
180-
fprintf(output, _(" \\prompt [TEXT] NAME\n"
181-
" prompt user to set internal variable\n"));
182-
fprintf(output, _(" \\password [USERNAME]\n"
183-
" securely change the password for a user\n"));
184174
fprintf(output, _(" \\q quit psql\n"));
185-
fprintf(output, _(" \\set [NAME [VALUE]]\n"
186-
" set internal variable, or list all if no parameters\n"));
187-
fprintf(output, _(" \\timing toggle timing of commands (currently %s)\n"),
188-
ON(pset.timing));
189-
fprintf(output, _(" \\unset NAME unset (delete) internal variable\n"));
190-
fprintf(output, _(" \\! [COMMAND] execute command in shell or start interactive shell\n"));
191175
fprintf(output, "\n");
192176

193177
fprintf(output, _("Query Buffer\n"));
@@ -202,11 +186,11 @@ slashUsage(unsigned short int pager)
202186
fprintf(output, "\n");
203187

204188
fprintf(output, _("Input/Output\n"));
189+
fprintf(output, _(" \\copy ... perform SQL COPY with data stream to the client host\n"));
205190
fprintf(output, _(" \\echo [STRING] write string to standard output\n"));
206191
fprintf(output, _(" \\i FILE execute commands from file\n"));
207192
fprintf(output, _(" \\o [FILE] send all query results to file or |pipe\n"));
208-
fprintf(output, _(" \\qecho [STRING]\n"
209-
" write string to query output stream (see \\o)\n"));
193+
fprintf(output, _(" \\qecho [STRING] write string to query output stream (see \\o)\n"));
210194
fprintf(output, "\n");
211195

212196
fprintf(output, _("Informational\n"));
@@ -241,8 +225,7 @@ slashUsage(unsigned short int pager)
241225
fprintf(output, _(" \\f [STRING] show or set field separator for unaligned query output\n"));
242226
fprintf(output, _(" \\H toggle HTML output mode (currently %s)\n"),
243227
ON(pset.popt.topt.format == PRINT_HTML));
244-
fprintf(output, _(" \\pset NAME [VALUE]\n"
245-
" set table output option\n"
228+
fprintf(output, _(" \\pset NAME [VALUE] set table output option\n"
246229
" (NAME := {format|border|expanded|fieldsep|footer|null|\n"
247230
" numericlocale|recordsep|tuples_only|title|tableattr|pager})\n"));
248231
fprintf(output, _(" \\t show only rows (currently %s)\n"),
@@ -252,8 +235,28 @@ slashUsage(unsigned short int pager)
252235
ON(pset.popt.topt.expanded));
253236
fprintf(output, "\n");
254237

255-
fprintf(output, _("Copy, Large Object\n"));
256-
fprintf(output, _(" \\copy ... perform SQL COPY with data stream to the client host\n"));
238+
fprintf(output, _("Connection\n"));
239+
fprintf(output, _(" \\c[onnect] [DBNAME|- USER|- HOST|- PORT|-]\n"
240+
" connect to new database (currently \"%s\")\n"),
241+
PQdb(pset.db));
242+
fprintf(output, _(" \\encoding [ENCODING] show or set client encoding\n"));
243+
fprintf(output, _(" \\password [USERNAME] securely change the password for a user\n"));
244+
fprintf(output, "\n");
245+
246+
fprintf(output, _("External\n"));
247+
fprintf(output, _(" \\cd [DIR] change the current working directory\n"));
248+
fprintf(output, _(" \\timing toggle timing of commands (currently %s)\n"),
249+
ON(pset.timing));
250+
fprintf(output, _(" \\! [COMMAND] execute command in shell or start interactive shell\n"));
251+
fprintf(output, "\n");
252+
253+
fprintf(output, _("Variable\n"));
254+
fprintf(output, _(" \\prompt [TEXT] NAME prompt user to set internal variable\n"));
255+
fprintf(output, _(" \\set [NAME [VALUE]] set internal variable, or list all if no parameters\n"));
256+
fprintf(output, _(" \\unset NAME unset (delete) internal variable\n"));
257+
fprintf(output, "\n");
258+
259+
fprintf(output, _("Large Object\n"));
257260
fprintf(output, _(" \\lo_export LOBOID FILE\n"
258261
" \\lo_import FILE [COMMENT]\n"
259262
" \\lo_list\n"

0 commit comments

Comments
 (0)