Terminal width for help output

Started by Peter Eisentrautabout 18 years ago12 messages
#1Peter Eisentraut
peter_e@gmx.net

Do we care to maintain a maximum width for programs' --help output (and psql's
\?)? I think 79 characters was once a recommendation (or perhaps 72), but we
have a couple of violations either way, which I'd like to fix, but what to?

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

#2Bruce Momjian
bruce@momjian.us
In reply to: Peter Eisentraut (#1)
Re: Terminal width for help output

Peter Eisentraut wrote:

Do we care to maintain a maximum width for programs' --help output (and psql's
\?)? I think 79 characters was once a recommendation (or perhaps 72), but we
have a couple of violations either way, which I'd like to fix, but what to?

Yea, I went over with the pg_ctl --timeout parameter and had to trim a
little. I would like us to keep it <80 myself.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

#3Joshua D. Drake
jd@commandprompt.com
In reply to: Peter Eisentraut (#1)
Re: Terminal width for help output

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 15 Nov 2007 21:58:28 +0100
Peter Eisentraut <peter_e@gmx.net> wrote:

Do we care to maintain a maximum width for programs' --help output
(and psql's \?)? I think 79 characters was once a recommendation (or
perhaps 72), but we have a couple of violations either way, which I'd
like to fix, but what to?

Why not just have the terminal control the wrap? It isn't just \? that
does it.

Sincerely,

Joshua D. Drake

- --

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 24x7/Emergency: +1.800.492.2240
PostgreSQL solutions since 1997 http://www.commandprompt.com/
UNIQUE NOT NULL
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHPLPqATb/zqfZUUQRAuu9AKCIBLRm0ehiWWW7RYi9zjles97/nACcCQu3
5aIzQRH0navadQQzCE6Xn64=
=tTOa
-----END PGP SIGNATURE-----

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#1)
Re: Terminal width for help output

Peter Eisentraut <peter_e@gmx.net> writes:

Do we care to maintain a maximum width for programs' --help output (and psql's
\?)? I think 79 characters was once a recommendation (or perhaps 72), but we
have a couple of violations either way, which I'd like to fix, but what to?

I think 79 is still a reasonable maximum. AFAIK 80 columns is still a
pretty standard terminal window width, but if you try to print in the
last column you may get unexpected extra blank lines.

regards, tom lane

#5Andrew Dunstan
andrew@dunslane.net
In reply to: Bruce Momjian (#2)
Re: Terminal width for help output

Bruce Momjian wrote:

Peter Eisentraut wrote:

Do we care to maintain a maximum width for programs' --help output (and psql's
\?)? I think 79 characters was once a recommendation (or perhaps 72), but we
have a couple of violations either way, which I'd like to fix, but what to?

Yea, I went over with the pg_ctl --timeout parameter and had to trim a
little. I would like us to keep it <80 myself.

+1. wrapping is annoying.

cheers

andrew

#6Joshua D. Drake
jd@commandprompt.com
In reply to: Tom Lane (#4)
Re: Terminal width for help output

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 15 Nov 2007 16:04:46 -0500
Tom Lane <tgl@sss.pgh.pa.us> wrote:

Peter Eisentraut <peter_e@gmx.net> writes:

Do we care to maintain a maximum width for programs' --help output
(and psql's \?)? I think 79 characters was once a recommendation
(or perhaps 72), but we have a couple of violations either way,
which I'd like to fix, but what to?

I think 79 is still a reasonable maximum. AFAIK 80 columns is still a
pretty standard terminal window width, but if you try to print in the
last column you may get unexpected extra blank lines.

O.k. this might be offtopic if it is feel free to smack me... but I
have noticed that psql really breaks on terminals that are wide.. \df
works fine, but \df+ is completely broke.

Can't we just ask the terminal?

Sincerely,

Joshua D. Drake

regards, tom lane

---------------------------(end of
broadcast)--------------------------- TIP 7: You can help support the
PostgreSQL project by donating at

http://www.postgresql.org/about/donate

- --

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 24x7/Emergency: +1.800.492.2240
PostgreSQL solutions since 1997 http://www.commandprompt.com/
UNIQUE NOT NULL
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHPLW4ATb/zqfZUUQRAtH2AJ0cm3Od8SibuI79osf8wG94pqGGnwCeNVjQ
qe+JxVIPris0akcrlCLeAO4=
=8pTZ
-----END PGP SIGNATURE-----

#7Bruce Momjian
bruce@momjian.us
In reply to: Joshua D. Drake (#6)
Re: Terminal width for help output

Joshua D. Drake wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 15 Nov 2007 16:04:46 -0500
Tom Lane <tgl@sss.pgh.pa.us> wrote:

Peter Eisentraut <peter_e@gmx.net> writes:

Do we care to maintain a maximum width for programs' --help output
(and psql's \?)? I think 79 characters was once a recommendation
(or perhaps 72), but we have a couple of violations either way,
which I'd like to fix, but what to?

I think 79 is still a reasonable maximum. AFAIK 80 columns is still a
pretty standard terminal window width, but if you try to print in the
last column you may get unexpected extra blank lines.

O.k. this might be offtopic if it is feel free to smack me... but I
have noticed that psql really breaks on terminals that are wide.. \df
works fine, but \df+ is completely broke.

Can't we just ask the terminal?

Peter is talking about --help text that is hard-coded into the binary,
meaning you don't run it through some filter before output.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

#8Alvaro Herrera
alvherre@alvh.no-ip.org
In reply to: Peter Eisentraut (#1)
Re: Terminal width for help output

Peter Eisentraut wrote:

Do we care to maintain a maximum width for programs' --help output (and psql's
\?)? I think 79 characters was once a recommendation (or perhaps 72), but we
have a couple of violations either way, which I'd like to fix, but what to?

79 is perfect IMHO. It would be great to ask translators to preserve
the constraint too.

Also it would rock if translation kept the alignment in various output.
For example, avoid stuff like

$ pg_controldata
Num�ro de version de pg_control : 833
Num�ro de version du catalogue : 200710232
Identifiant du syst�me de base de donn�es : 5125738698090412341
Etat du groupe de base de donn�es : arr�t
Derni�re modification de pg_control : jeu 15 nov 2007 08:17:22 CLST
Derni�re localisation du point de contr�le: 0/4D06F8
Pr�c�dente localisation du point de contr�le: 0/4B9818
Derni�re localisation de reprise du point de contr�le : 0/4D06F8
Dernier TimeLineID du point de v�rification : 1
Dernier NextXID du point de contr�le : 0/395
Dernier NextXOID du point de contr�le : 16407
Dernier NextMultiXactId du point de contr�le : 1
Dernier NextMultiOffset du point de contr�le : 0
Heure du dernier point de contr�le : jeu 15 nov 2007 08:17:22 CLST
Emplacement de fin de la r�cup�ration minimale: 0/0
Alignement maximale de la donn�e : 8
Taille de bloc de la base de donn�es : 8192
Blocs par segment pour une relation importante : 131072
Taille de bloc du WAL : 8192
Octets par segment WAL : 16777216
Taille maximale des identifiants : 64
Nombre de colonnes maximum d'un index: 32
Maximum size of a TOAST chunk: 1996
Stockage du type date/heure : nombres � virgule flottante
Taille maximum d'un nom local : 128
LC_COLLATE : fr_CA.UTF-8
LC_CTYPE : fr_CA.UTF-8

--
Alvaro Herrera http://www.amazon.com/gp/registry/DXLWNGRJD34J
"Those who use electric razors are infidels destined to burn in hell while
we drink from rivers of beer, download free vids and mingle with naked
well shaved babes." (http://slashdot.org/comments.pl?sid=44793&amp;cid=4647152)

#9Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#8)
Re: Terminal width for help output

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:

Also it would rock if translation kept the alignment in various output.

Theoretically the translators are supposed to do that already ...

regards, tom lane

#10Jonah H. Harris
jonah.harris@gmail.com
In reply to: Alvaro Herrera (#8)
Re: Terminal width for help output

On Nov 15, 2007 4:56 PM, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:

Peter Eisentraut wrote:

Do we care to maintain a maximum width for programs' --help output (and psql's
\?)? I think 79 characters was once a recommendation (or perhaps 72), but we
have a couple of violations either way, which I'd like to fix, but what to?

79 is perfect IMHO. It would be great to ask translators to preserve
the constraint too.

Agreed, all my terminals are set to standard 80 cols and I always
manually wrap at 79 just to be safe.

--
Jonah H. Harris, Sr. Software Architect | phone: 732.331.1324
EnterpriseDB Corporation | fax: 732.331.1301
499 Thornall Street, 2nd Floor | jonah.harris@enterprisedb.com
Edison, NJ 08837 | http://www.enterprisedb.com/

#11Guillaume Lelarge
guillaume@lelarge.info
In reply to: Alvaro Herrera (#8)
Re: Terminal width for help output

Alvaro Herrera a �crit :

Peter Eisentraut wrote:

Do we care to maintain a maximum width for programs' --help output (and psql's
\?)? I think 79 characters was once a recommendation (or perhaps 72), but we
have a couple of violations either way, which I'd like to fix, but what to?

79 is perfect IMHO. It would be great to ask translators to preserve
the constraint too.

I wasn't aware of the constraint. Now, I'll do it. Are there other
constraints that translators should know about ?

Also it would rock if translation kept the alignment in various output.
For example, avoid stuff like

$ pg_controldata
Num�ro de version de pg_control : 833
Num�ro de version du catalogue : 200710232
Identifiant du syst�me de base de donn�es : 5125738698090412341
Etat du groupe de base de donn�es : arr�t
Derni�re modification de pg_control : jeu 15 nov 2007 08:17:22 CLST
Derni�re localisation du point de contr�le: 0/4D06F8
Pr�c�dente localisation du point de contr�le: 0/4B9818
Derni�re localisation de reprise du point de contr�le : 0/4D06F8
Dernier TimeLineID du point de v�rification : 1
Dernier NextXID du point de contr�le : 0/395
Dernier NextXOID du point de contr�le : 16407
Dernier NextMultiXactId du point de contr�le : 1
Dernier NextMultiOffset du point de contr�le : 0
Heure du dernier point de contr�le : jeu 15 nov 2007 08:17:22 CLST
Emplacement de fin de la r�cup�ration minimale: 0/0
Alignement maximale de la donn�e : 8
Taille de bloc de la base de donn�es : 8192
Blocs par segment pour une relation importante : 131072
Taille de bloc du WAL : 8192
Octets par segment WAL : 16777216
Taille maximale des identifiants : 64
Nombre de colonnes maximum d'un index: 32
Maximum size of a TOAST chunk: 1996
Stockage du type date/heure : nombres � virgule flottante
Taille maximum d'un nom local : 128
LC_COLLATE : fr_CA.UTF-8
LC_CTYPE : fr_CA.UTF-8

+1

Thanks for the tips.

--
Guillaume.
http://www.postgresqlfr.org
http://dalibo.com

#12Sam Mason
sam@samason.me.uk
In reply to: Alvaro Herrera (#8)
Re: Terminal width for help output

On Thu, Nov 15, 2007 at 06:56:06PM -0300, Alvaro Herrera wrote:

Peter Eisentraut wrote:

Do we care to maintain a maximum width for programs' --help output (and psql's
\?)? I think 79 characters was once a recommendation (or perhaps 72), but we
have a couple of violations either way, which I'd like to fix, but what to?

79 is perfect IMHO. It would be great to ask translators to preserve
the constraint too.

I thought that <79 was good because if output was copied/pasted into an
email that didn't fold lines nicely then output wouldn't get immediately
mangled.

Sam