On Wed, 23 Aug 2023, Pietro Cerutti wrote:

> Hi,
> 
> here at FreeBSD, we vendor in your netcat with a few local modifications.
> 
> I'm working on adding support to --crlf. I have a diff against the FreeBSD
> version here: https://reviews.freebsd.org/D41489
> 
> I'd like this to be upstreamed. If there's consensus, I'll prepare a patch
> against OpenBSD's version and send it over.

What is the motivation for this option beyond "Linux has it"? Correct
me if I'm wrong but it seems trivial to do this conversion without
writing more code by sticking tr in a pipe with nc.

OpenBSD's nc doesn't use getopt_long at present and I'm not sure there
would be appetite to do it for a single new flag. I note that nc on the
Debian machine I have at hand does -C but doesn't recognise --crlf.
IMO the long option therefore just adds incompatibility.

[djm@dvm ~]$ nc --crlf
nc: invalid option -- '-'
usage: nc [-46CDdFhklNnrStUuvZz] [-I length] [-i interval] [-M ttl]
         [-m minttl] [-O length] [-P proxy_username] [-p source_port]
         [-q seconds] [-s sourceaddr] [-T keyword] [-V rtable] [-W recvlimit]
         [-w timeout] [-X proxy_protocol] [-x proxy_address[:port]]
         [destination] [port]
[djm@dvm ~]$ uname -a
Linux dvm 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.38-1 (2023-07-14) 
x86_64 GNU/Linux


-d

Reply via email to