summaryrefslogtreecommitdiff
path: root/src/bin/psql/help.c
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2015-03-28 11:07:41 -0400
committerAndrew Dunstan <andrew@dunslane.net>2015-03-28 11:07:41 -0400
commit7655f4ccea570d57c4d473cd66b755c03c904942 (patch)
tree66c54949a4abf3816b9826709728317889053bd5 /src/bin/psql/help.c
parentcfe12763c32437bc708a64ce88a90c7544f16185 (diff)
Add a pager_min_lines setting to psql
If set, the pager will not be used unless this many lines are to be displayed, even if that is more than the screen depth. Default is zero, meaning it's disabled. There is probably more work to be done in giving the user control over when the pager is used, particularly when wide output forces use of the pager regardless of how many lines there are, but this is a start.
Diffstat (limited to 'src/bin/psql/help.c')
-rw-r--r--src/bin/psql/help.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index ac0dc279078..2da444b6d59 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -65,7 +65,7 @@ usage(unsigned short int pager)
}
}
- output = PageOutput(59, pager);
+ output = PageOutput(59, pager ? &(pset.popt.topt) : NULL);
fprintf(output, _("psql is the PostgreSQL interactive terminal.\n\n"));
fprintf(output, _("Usage:\n"));
@@ -158,7 +158,7 @@ slashUsage(unsigned short int pager)
currdb = PQdb(pset.db);
- output = PageOutput(103, pager);
+ output = PageOutput(103, pager ? &(pset.popt.topt) : NULL);
/* if you add/remove a line here, change the row count above */
@@ -305,7 +305,7 @@ helpVariables(unsigned short int pager)
{
FILE *output;
- output = PageOutput(85, pager);
+ output = PageOutput(85, pager ? &(pset.popt.topt) : NULL);
fprintf(output, _("List of specially treated variables.\n"));
@@ -435,7 +435,7 @@ helpSQL(const char *topic, unsigned short int pager)
ncolumns = Max(ncolumns, 1);
nrows = (QL_HELP_COUNT + (ncolumns - 1)) / ncolumns;
- output = PageOutput(nrows + 1, pager);
+ output = PageOutput(nrows + 1, pager ? &(pset.popt.topt) : NULL);
fputs(_("Available help:\n"), output);
@@ -488,7 +488,7 @@ helpSQL(const char *topic, unsigned short int pager)
if (wordlen >= len) /* Don't try again if the same word */
{
if (!output)
- output = PageOutput(nl_count, pager);
+ output = PageOutput(nl_count, pager ? &(pset.popt.topt) : NULL);
break;
}
len = wordlen;
@@ -509,7 +509,7 @@ helpSQL(const char *topic, unsigned short int pager)
}
if (!output)
- output = PageOutput(nl_count, pager);
+ output = PageOutput(nl_count, pager ? &(pset.popt.topt) : NULL);
for (i = 0; QL_HELP[i].cmd; i++)
{