bug#47243: pr lacks -p

Collin Funk <[email protected]>
Newsgroups gmane.comp.gnu.core-utils.bugs
Message-ID <[email protected]>
Hi Pádraig,

Pádraig Brady <[email protected]> writes:

>>> Given that hardly anybody uses pr any more, I'm surprised that the
>>> Austin Group still cares about its options. It's an obsolete utility,
>>> and ought to be deprecated.
>> True, but this option seems simple enough to implement.
>> How about the attached patch?
>
> I would just ignore the -p if stdin/stdout are not a tty.
> That would make a test easier anyway, to ensure
> `pr -p file >/dev/null` passes.

Thanks for the input.

I was conflicted on whether the best behavior was to warn, error, or
ignore the option in those cases. And whether it should be ignored if
standard out was not a tty. I guess it would be pointless to do, for
example, 'pr -p ChangeLog < file-full-of-newlines'.

I have attached the V2 patch which adds the additional check for
'isatty (STDIN_FILENO)' (V1 only had it for STDERR_FILENO), documents
that behavior, and adds a NEWS entry.

I'll push tomorrow to give others some time to comment.

Collin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.