Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Mar 2021 17:23:55 -0500
From:      Ed Maste <emaste@freebsd.org>
Cc:        FreeBSD Hackers <freebsd-hackers@freebsd.org>,  FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: Rationalizing sed -i/-I (in-place editing) argument handling
Message-ID:  <CAPyFy2ADKsr880f_SEjjHnEnXOqf4eEgR632CDC1q%2BQps9DQEw@mail.gmail.com>
In-Reply-To: <CAPyFy2CQ9uUPWx4F03aUXwf9u23Rm4MvRzfKnz%2BFeBcj3sow-w@mail.gmail.com>
References:  <CAPyFy2DJcNsDd0tmfyuumDkxXoBDYDmNTqGL8VOsMjk3cr2=3A@mail.gmail.com> <8e9983a4243d158789029ec8b16837b35ca4451a.camel@freebsd.org> <CAPyFy2CQ9uUPWx4F03aUXwf9u23Rm4MvRzfKnz%2BFeBcj3sow-w@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
 On Mon, 8 Mar 2021 at 16:41, Ed Maste <emaste@freebsd.org> wrote:
>
> On Mon, 8 Mar 2021 at 15:55, Ian Lepore <ian@freebsd.org> wrote:
> >
> > I also hate the idea of requiring no space between -I and its related
> > value.  That seems like a huge POLA violation compared to how virtually
> > every other command's options and arguments work.
>
> On the other hand, -i.ext with no space is compatible with FreeBSD
> today and is portable to OpenBSD, NetBSD, macOS, and GNU. -i .ext
> works only with FreeBSD and macOS.

I'd like to go ahead with a man page update shortly. Even if we do not
modify sed, it is valuable to document and describe the compatibility
issues with our -i/-I, including the odd way we specify no backup
file.

On the topic of POLA our -i/-I support was based on perl's in-place
editing, except perl uses the optional argument style (-i / -i.bak).
I'd also argue that our -i "" is a POLA violation compared to how most
other commands work, and has caused significant confusion for folks
interested in cross-OS compatibility.

If anyone has suggestions or improvements to the proposed man page
text I'd appreciate a follow-up here or a comment in the review,
https://reviews.freebsd.org/D29128.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPyFy2ADKsr880f_SEjjHnEnXOqf4eEgR632CDC1q%2BQps9DQEw>