From owner-cvs-all Tue May 7 12:16:26 2002 Delivered-To: cvs-all@freebsd.org Received: from finntroll.newgold.net (durham-ar1-4-64-252-019.durham.dsl-verizon.net [4.64.252.19]) by hub.freebsd.org (Postfix) with SMTP id 826C837B40C for ; Tue, 7 May 2002 12:16:13 -0700 (PDT) Received: (qmail 30061 invoked by uid 1001); 7 May 2002 19:20:00 -0000 Date: Tue, 7 May 2002 19:20:00 +0000 From: "J. Mallett" To: John Baldwin Cc: "J. Mallett" , cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, Garrett Rooney Subject: Re: cvs commit: src/usr.bin/sed main.c sed.1 Message-ID: <20020507191959.GA26441@FreeBSD.ORG> References: <20020507184519.GB28857@FreeBSD.ORG> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.27i Organisation: The FreeBSD Project Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, May 07, 2002 at 03:06:37PM -0400, John Baldwin wrote: > > On 07-May-2002 J. Mallett wrote: > > On Tue, May 07, 2002 at 02:39:43PM -0400, Garrett Rooney wrote: > >> On Tue, May 07, 2002 at 11:32:18AM -0700, J. Mallett wrote: > >> > >> > Reviewed by: developers@ (got feedback from: des, fanf, sobomax, > >> > roberto, > >> > obrien) > >> > >> is there a reason this was posted to developers@, rather than one of > >> the public mailing lists? it really doesn't seem like an additional > >> flag for sed is something that needs to be discussed in private. > > > > It came up in a discussion, and I felt sorta like I'd been dared to do it, so > > I replied when I'd done it, and it got a surprisingly good response, so I > > decided to clean it up, and commit it, once I'd satisfied all of my concerns > > with it. > > It still would have been a good idea to send out the actual patch for review > on a public list. Personally, I won't use sed -i if it insists on leaving > backup files around that I have to go the trouble to delete. I might as well > just do sed 'foo' < foo > foo.bak. I only use -i when I'm not specifying a > backup extension. Those are the only times I use perl in fact, and thus I > will probably continue to use perl for such things. Various points taken. Tell me the preferred way to handle options which may or may not take arguments, and I'll give it my best shot. I'd assume it's to do something like case 'i': if (*argv[optind+1] != '-') { take the option from argv[optind++]; } else set a binary flag for -i, and don't set the extension. break; Does that seem right? And you're also 50% wrong, John. No that is not what you might as well do, as it doesn't handle multiple files. As for the droppings, what I have in mind to do is just unlink the backup, if the extension was not given, and to find some good extension to use to reopen for stdin. Seem reasonable? -- jmallett@FreeBSD.org | C, MIPS, POSIX, UNIX, BSD, IRC Geek. http://www.FreeBSD.org | The Power to Serve "I've never tried to give my life meaning by demeaning you." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message