Thread: Terminal width for help output

Terminal width for help output

From
Peter Eisentraut
Date:
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/


Re: Terminal width for help output

From
"Joshua D. Drake"
Date:
-----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-----

Re: Terminal width for help output

From
Bruce Momjian
Date:
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. +


Re: Terminal width for help output

From
Tom Lane
Date:
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


Re: Terminal width for help output

From
Andrew Dunstan
Date:

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


Re: Terminal width for help output

From
"Joshua D. Drake"
Date:
-----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-----

Re: Terminal width for help output

From
Bruce Momjian
Date:
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. +


Re: Terminal width for help output

From
Alvaro Herrera
Date:
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&cid=4647152)


Re: Terminal width for help output

From
Tom Lane
Date:
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


Re: Terminal width for help output

From
"Jonah H. Harris"
Date:
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/


Re: Terminal width for help output

From
Guillaume Lelarge
Date:
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.orghttp://dalibo.com


Re: Terminal width for help output

From
Sam Mason
Date:
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