[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: nl: -d option with a single character
From: |
Bernhard Voelker |
Subject: |
Re: nl: -d option with a single character |
Date: |
Mon, 14 Dec 2020 23:27:10 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 |
Hi Padraig,
On 12/14/20 5:53 PM, Pádraig Brady wrote:
> I've attached two patches to address this.
'git am' complains:
Patch format detection failed.
At least the usual patch end marker "---\n$GITVERSION" seems to be
missing, but adding one doesn't help either; 'patch -p1' works though.
There's one more place to clarify the GNU extension:
$ nl --help
...
-d, --section-delimiter=CC use CC for logical page delimiters
...
CC are two delimiter characters used to construct logical page delimiters;
a missing second character implies ':'.
Finally: what about 0-length section-delimiters?
$ nl -d ''
Should we document this case as well?
The patch also fixes this case - and now uses the whole
DEFAULT_SECTION_DELIMITERS:
$ printf '%s\n' a '\:' c | /usr/bin/nl -d ''
1 a
2 \:
3 c
$ printf '%s\n' a '\:' c | src/nl -d ''
1 a
c
Therefore, `nl -d ''` is identical with `nl -d '\:'` now. This behavior
looks more consistent than before to me.
Thanks & have a nice day,
Berny