From owner-freebsd-arch@FreeBSD.ORG Fri May 28 10:25:47 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5FBFA16A4CE for ; Fri, 28 May 2004 10:25:47 -0700 (PDT) Received: from smtp2.server.rpi.edu (smtp2.server.rpi.edu [128.113.2.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0596143D53 for ; Fri, 28 May 2004 10:25:47 -0700 (PDT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp2.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i4SHOXIX019310; Fri, 28 May 2004 13:24:33 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <20040528155139.GB85017@stack.nl> References: <20040528155139.GB85017@stack.nl> Date: Fri, 28 May 2004 13:24:31 -0400 To: Jilles Tjoelker From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) cc: arch@FreeBSD.ORG Subject: Re: Change to "kludge option processing" in /bin/ps X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2004 17:25:47 -0000 At 5:51 PM +0200 5/28/04, Jilles Tjoelker wrote: >On Sun, May 23, 2004, Garance A Drosihn wrote: > >> If anyone wants to try the update, it is available at: >> > > http://people.freebsd.org/~gad/ps-kludge.diff >> > > Assuming there aren't any major objections to these ideas, I plan > > to do some more testing on this and commit it next weekend. > >What's the deeper purpose of the `optlist' argument for >`kludge_oldps_options' if it's always set to PS_ARGS? a) After a future update, it may be set to something else. b) An earlier version of this update called the kludge- processing for all remaining arguments, and used NULL for optlist to distinguish between argument #1 and "all the rest". After a little testing I realized that that idea was simply not going to work the way I wanted it to, so I got rid of that code but left the parameter. >I have some doubts on whether `ps t' instead of `ps T' should >still be supported, since `ps t p0' doesn't work because of it. >You could only change 't' to 'T' when there are no more >arguments. Hmm, that is an interesting point. I'll check into it. I should note that I'm not going to knock myself out trying to create ideal processing for the historical '-'-less options. However I do think I might be able to improve on the 't'-kludge a little bit more. >Am I right that `ps U0' is equivalent to `ps -U0' with the patch? >(This wasn't really much of an issue before `-U' accepted uids >instead of names.) Yes, after the patch `ps U0' == `ps -U0' Before the patch, `ps U0' == ps: No user named 'p0' >What happens when you do `ps 1,2,3,4'? And `ps uww0,1'? Or even >`ps "v1 $$"'? `ps 1,2,3,4' == `ps -p 1,2,3,4' `ps uww0,1' == `ps -uww -p0,1' BUT `ps u ww0,1' == an error, since kludge processing is only done on argument #1 `ps v1 10' == `ps -p1 -p10' `ps "v1 10"' == an error, for reasons unrelated to this update >All this complexity makes me think of not using getopt(3), as >Albert Cahalan suggested :) Eh. I don't think it's all that bad, not yet at least. As long as we limit "kludge" (the "-"-less option) processing to the first argument, I think we can use getopt() without too much trouble. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu