diff options
author | Bruce Momjian <bruce@momjian.us> | 1996-10-09 00:15:44 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1996-10-09 00:15:44 +0000 |
commit | 9b1e61b7e946c333f26ceff9e251c8faa6413e5d (patch) | |
tree | 27152e17fd7d0f0085cdca5201cf467c92a8ee51 /src | |
parent | c306d06cf9d48e3e861f63fba19affd42a83c6d3 (diff) | |
download | postgresql-9b1e61b7e946c333f26ceff9e251c8faa6413e5d.tar.gz postgresql-9b1e61b7e946c333f26ceff9e251c8faa6413e5d.zip |
Changed psql \h command to print commands in three columns.
No more scrolling off the screen.
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/psql/psql.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/bin/psql/psql.c b/src/bin/psql/psql.c index fedd9fb85ba..af54d7c85e5 100644 --- a/src/bin/psql/psql.c +++ b/src/bin/psql/psql.c @@ -7,7 +7,7 @@ * * * 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; int i, numCmds; int all_help = 0; + char left_center_right = 'L'; if (!optarg) { printf("type \\h <cmd> where <cmd> is one of the following:\n"); i = 0; 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++; } + if (left_center_right != 'L') + puts("\n"); printf("type \\h * for a complete description of all commands\n"); } else |