From yar@jujik.ramtel.ru  Fri Aug 18 13:33:49 2006
Return-Path: <yar@jujik.ramtel.ru>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 3CA0B16A4E6;
	Fri, 18 Aug 2006 13:33:49 +0000 (UTC)
	(envelope-from yar@jujik.ramtel.ru)
Received: from jujik.ramtel.ru (jujik.ramtel.ru [81.19.64.112])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 94A1F43D46;
	Fri, 18 Aug 2006 13:33:48 +0000 (GMT)
	(envelope-from yar@jujik.ramtel.ru)
Received: from jujik.ramtel.ru (localhost [127.0.0.1])
	by jujik.ramtel.ru (8.13.7/8.13.7) with ESMTP id k7IDXkl0026572;
	Fri, 18 Aug 2006 17:33:46 +0400 (MSD)
	(envelope-from yar@jujik.ramtel.ru)
Received: (from yar@localhost)
	by jujik.ramtel.ru (8.13.7/8.13.7/Submit) id k7IDXkZm026571;
	Fri, 18 Aug 2006 17:33:46 +0400 (MSD)
	(envelope-from yar)
Message-Id: <200608181333.k7IDXkZm026571@jujik.ramtel.ru>
Date: Fri, 18 Aug 2006 17:33:46 +0400 (MSD)
From: Yar Tikhiy <yar@comp.chem.msu.su>
To: FreeBSD-gnats-submit@freebsd.org
Cc: gad@freebsd.org
Subject: Defects in -O option to ps(1)
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         102232
>Category:       bin
>Synopsis:       Defects in -O option to ps(1)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gad
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 18 13:40:13 GMT 2006
>Closed-Date:    
>Last-Modified:  Mon Aug 21 02:34:30 GMT 2006
>Originator:     Yar Tikhiy
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
None
>Environment:
	FreeBSD-CURRENT

>Description:
	1. Multiple -O options to ps(1) result in ill-looking output.
	   Using multiple -O options can be necessary if one wants to
	   supply blank column titles for the columns added.  (Why not?)
	   Ability to supply multiple -O options to ps(1) would be consistent
	   with that for multiple -o options.

	2. Using -O along with flags changing the default columns,
	   e.g., -u, produces ill-looking output.

>How-To-Repeat:

%ps -O jid -O rss
  PID    JID  TT  STAT      TIME COMMAND            RSS
  768      0  p0  Ss     0:00.64 -csh (csh)        4044
 1405      0  p0  R+     0:00.01 ps -O jid -O rss  1012
 1007      0  p1  Is     0:00.05 -csh (csh)        2944

%ps -u -O jid
USER   PID %CPU %MEM   VSZ   RSS  TT  STAT STARTED      TIME COMMAND            PID    JID  TT  STAT      TIME COMMAND
yar    768  0.0  3.5  6116  4044  p0  Ss    3:37PM   0:00.64 -csh (csh)         768      0  p0  Ss     0:00.64 -csh (csh)
yar   1406  0.0  0.9  5228  1012  p0  R+    5:19PM   0:00.01 ps -u -O jid      1406      0  p0  R+     0:00.01 ps -u -O jid
yar   1007  0.0  2.5  4744  2944  p1  Is    4:21PM   0:00.05 -csh (csh)        1007      0  p1  Is     0:00.05 -csh (csh)

>Fix:
	Have ps(1) construct 3 internal lists of keywords to display
	instead of the current single list: leading, user-supplied,
	and trailing.  Options like -u would switch the 1st and 3rd
	lists then.  Option -o would set the 1st and 3rd lists to
	nil once before filling the 2nd one.  Option -O would just
	fill the 2nd list.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->gad 
Responsible-Changed-By: gad 
Responsible-Changed-When: Mon Aug 21 02:31:20 UTC 2006 
Responsible-Changed-Why:  
.  I know what you're talking about.  I had a fix for it in one of my 
test versions of 'ps', but never got around to installing those changes 
(it was part of a much larger set of changes).  I am pretty busy for 
the next two or three weeks, but I should be able to look into this 
sometime after that. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=102232 
>Unformatted:
