mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-04 04:56:50 +02:00
Changed psql \h command to print commands in three columns.
No more scrolling off the screen.
This commit is contained in:
parent
c306d06cf9
commit
9b1e61b7e9
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.21 1996/09/16 06:06:11 scrappy Exp $
|
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.22 1996/10/09 00:15:44 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -805,15 +805,32 @@ HandleSlashCmds(PsqlSettings *settings,
|
|||||||
char *cmd;
|
char *cmd;
|
||||||
int i, numCmds;
|
int i, numCmds;
|
||||||
int all_help = 0;
|
int all_help = 0;
|
||||||
|
char left_center_right = 'L';
|
||||||
|
|
||||||
if (!optarg) {
|
if (!optarg) {
|
||||||
printf("type \\h <cmd> where <cmd> is one of the following:\n");
|
printf("type \\h <cmd> where <cmd> is one of the following:\n");
|
||||||
i = 0;
|
i = 0;
|
||||||
while (QL_HELP[i].cmd != NULL)
|
while (QL_HELP[i].cmd != NULL)
|
||||||
{
|
{
|
||||||
printf("\t%s\n", QL_HELP[i].cmd);
|
switch(left_center_right)
|
||||||
|
{
|
||||||
|
case 'L':
|
||||||
|
printf(" %-25s", QL_HELP[i].cmd);
|
||||||
|
left_center_right = 'C';
|
||||||
|
break;
|
||||||
|
case 'C':
|
||||||
|
printf("%-25s", QL_HELP[i].cmd);
|
||||||
|
left_center_right = 'R';
|
||||||
|
break;
|
||||||
|
case 'R':
|
||||||
|
printf("%-25s\n", QL_HELP[i].cmd);
|
||||||
|
left_center_right = 'L';
|
||||||
|
break;
|
||||||
|
};
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
if (left_center_right != 'L')
|
||||||
|
puts("\n");
|
||||||
printf("type \\h * for a complete description of all commands\n");
|
printf("type \\h * for a complete description of all commands\n");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user