gnulib-tool-py
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gnulib-tool-py] GNU GPLv3+ long license string


From: Bruno Haible
Subject: Re: [gnulib-tool-py] GNU GPLv3+ long license string
Date: Sun, 29 Apr 2012 20:51:50 +0200
User-agent: KMail/4.7.4 (Linux/3.1.10-1.9-desktop; KDE/4.7.4; x86_64; ; )

Hi Dmitriy,

> [License GPLv3+: GNU GPL version 3 or later <
> http://gnu.org/licenses/gpl.html>]
> 
> Can I replace it to almost the same but with newline (and may be two
> spaces)?
> 
> [License GPLv3+: GNU GPL version 3 or later
>   <http://gnu.org/licenses/gpl.html>]

The output format of the '--help' option is more or less described in the
GNU standards at
  <http://www.gnu.org/prep/standards/standards.html#g_t_002d_002dversion>
Citation:
  "The following line, after the version number line or lines, should
   be a copyright notice. If more than one copyright notice is called
   for, put each on a separate line."

So, we try to put every notice in a single line, and we succeeded.
The width is 77 columns:

$ ./gnulib-tool --version | wc -L
77

In general we assume that text output windows will have 80 columns or more.
On some systems (e.g. OSF/1) the terminal descriptions are suboptimal,
with the consequence that only 79 columns are really available; the last
column is always blank.

For this reason, we try to have output fit in 79 columns normally. It's
not a tragedy if if needs 80 columns. But more than 80 columns is not
pretty.

In summary, I don't see the reason for adding a newline in the output here.

> And this is really ugly when one string is too long if compare to others
> (type `gnulib-tool --version` to understand what I mean).

Yup, there are some short and some long lines - an esthetic disadvdantage.
But a structure of one line for this purpose, one line for another purpose,
is an advantage.

> I completely dislike such a long strings, while on some systems it is
> recommended to use strings not more than 80 symbols length. The line in my
> code with indents takes 95 symbols with spaces.

There are several ways to produce a long output line, without having
extra-wide lines in the source code:
  - According to the Python Language Reference section 2.4.1
    <http://docs.python.org/reference/lexical_analysis.html#literals>
    you can use a backslash-newline sequence inside the string.
  - According to the Python Library Reference section 5.6
    <http://docs.python.org/library/stdtypes.html#typesseq>
    you can also write two strings and concatenate them with the '+'
    operator.
  - You can also use a format string such as "{0}{1}" to combine two
    string pieces.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]