From owner-freebsd-current@freebsd.org Thu Mar 11 22:24:38 2021 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5AAD95AE392 for ; Thu, 11 Mar 2021 22:24:38 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DxNm53kFXz4TN1 for ; Thu, 11 Mar 2021 22:24:37 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-il1-f180.google.com with SMTP id v14so785881ilj.11 for ; Thu, 11 Mar 2021 14:24:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:cc; bh=cjdqkVu9gJYb1fFpXZ2kaWg3Y4SH534Wcv+nivTe0Mw=; b=IcvqgzUjgYR/9qVo+LdV6vjBfdUATyIZ4LPX47XUfeUeuRUV1DMNm7JAOCFiL8Skab RHQLD4+QhHklAU0MIVcgHz6LjrXVKyJyduyNkHw2yNm7A/wss/f7MoRTLinp9agqa4/X steq9gu7gtREmLrK9BHpsZgCZYS2BeuPmCMo8S2ja6yuv1ovosnTUF2BbXSnrMKgTG0r MAh54iTx1N6MAQV2BIng74zwXYHI73Ie/OmRE1yJMquFXP774Ce/7YbbKNzm8StUQpF5 47roRrrm154o18SfHLkubW0E4fHoIlk4+BJD3QXc+0+OwKRNVJ9b/kmH6oRR37cuXE0O rHpA== X-Gm-Message-State: AOAM533mO4DQclbfUGUJFjC+7GNWtN4gaYZqpBBgK15eIm6MESiI69XR GFbI6RyoH4vwwIBFmUs7RB3ASkrs7h1V+aND0zE= X-Received: by 2002:a92:c690:: with SMTP id o16mt535562ilg.256.1615501476402; Thu, 11 Mar 2021 14:24:36 -0800 (PST) MIME-Version: 1.0 References: <8e9983a4243d158789029ec8b16837b35ca4451a.camel@freebsd.org> In-Reply-To: From: Ed Maste Date: Thu, 11 Mar 2021 17:23:55 -0500 Message-ID: Subject: Re: Rationalizing sed -i/-I (in-place editing) argument handling Cc: FreeBSD Hackers , FreeBSD Current Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4DxNm53kFXz4TN1 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.180 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-1.00 / 15.00]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; MISSING_TO(2.00)[]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RBL_DBL_DONT_QUERY_IPS(0.00)[209.85.166.180:from]; R_DKIM_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FREEFALL_USER(0.00)[carpeddiem]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; SPAMHAUS_ZRD(0.00)[209.85.166.180:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.166.180:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.166.180:from]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-current] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Mar 2021 22:24:38 -0000 On Mon, 8 Mar 2021 at 16:41, Ed Maste wrote: > > On Mon, 8 Mar 2021 at 15:55, Ian Lepore 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.