Re: Make --help output fit within 80 columns per line

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: torikoshia <torikoshia(at)oss(dot)nttdata(dot)com>, htamfids(at)gmail(dot)com
Cc: Masahiro Ikeda <ikedamsh(at)oss(dot)nttdata(dot)com>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Make --help output fit within 80 columns per line
Date: 2023-10-06 10:49:32
Message-ID: 8decb0e3-6463-9eda-00dc-a05a3340b8bb@eisentraut.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 25.09.23 08:27, torikoshia wrote:
>> So in summary, I think 80 is a decent soft limit, but let's not stress
>> out about some lines going over that, and make a hard limit of perhaps
>> 120.
>
> +1. It may be a good compromise.
> For enforcing the hard limit, is it better to add a regression test like
> patch 0001?

> Agreed. It seems inconsistent with other commands.
> Patch 0002 removed environment-variable-based defaults in psql --help.

I have committed 0002 and a different implementation of 0001. I set the
maximum line length to 95, which is the current maximum in use.

I'm open to discussing other line lengths, but

1) If we make it longer, then we should also adjust the existing
wrapping so that we don't have a mix of lines wrapped at 80 and some
significantly longer lines.

2) There are some general readability guidelines that suggest like 66 or
72 characters per line. If you take that and add the option name itself
and some indentation, then around 90 does seem like a sensible limit.

3) The examples from other tools posted earlier don't convince me. Some
of their --help outputs look like junk and poorly taken care of.

So I think nudging people to aim for 80..95 seems like a good target
right now. But I'm not against adjustments.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabrice Chapuis 2023-10-06 10:49:49 Re: wal recycling problem
Previous Message shveta malik 2023-10-06 10:32:01 Re: Synchronizing slots from primary to standby