From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Count output lines automatically in psql/help.c |
Date: | 2022-06-03 20:51:30 |
Message-ID: | 365160.1654289490@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
I finally reached the point of being fed up with our inability
to maintain the number of lines output by psql's usage() and
sibling functions. Almost every year, we find ourselves updating
those magic constants sometime late in the dev cycle, and I just
had to do it again today.
So, attached is a patch to remove that maintenance chore by
constructing the output in a PQExpBuffer and then counting the
lines automatically. While I was at it, I introduced a couple of
macros to make the code shorter rather than longer.
We could alternatively decide that we've blown past whatever
vertical screen space anybody has and just use 1000 or something
like that as the PageOutput count. However, that's a somewhat
dicey proposition for usage() itself, which is at 63 lines today;
that's well within reach of larger monitors.
Thoughts?
regards, tom lane
Attachment | Content-Type | Size |
---|---|---|
count-help-lines-automatically-1.patch | text/x-diff | 47.7 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2022-06-03 20:58:08 | Re: Collation version tracking for macOS |
Previous Message | Thomas Munro | 2022-06-03 20:17:19 | Re: Collation version tracking for macOS |