Hi Jan, Jan Stary wrote on Mon, May 20, 2013 at 02:16:56PM +0200:
> mandoc lint complaint about a .Bl not closed with an .El Your patch is correct. While checking the port, i found some more things to fix. Improvements of the content of the manual: - The -p flag and the process ID arguments have different semantics, so it's a very bad idea to call both ".Ar pid". Use ".Op Fl p Ar pid .Op Ar rootpid ..." instead. - With more than one rootpid argument, pstree(1) shows more than one process tree, so use the plural in the DESCRIPTION. Clarify the description of rootpid and avoid ugly parenthetic remarks. - Avoid another ugly parenthetic remark for -f-; instead, use the same wording as in cat(1). - For -p, -s, and -u, clarify what branches are, talking about parents and descendants explicitly. - Add missing ENVIRONMENT, EXIT STATUS, and AUTHORS sections. - Add an example for -p, since the difference between -p pid and rootpid arguments is quite subtle. Formal improvements: - Use Mdocdate. - Sort options in the SYNOPSIS. - Sort options in the DESCRIPTION. - Remove USE_GROFF. - Bump revision. I'm planning to delay the commit because i sent private mail to Sebastian Stark, asking for permission to add his copyright and a license to the manual page. Yours, Ingo Index: Makefile =================================================================== RCS file: /cvs/ports/sysutils/pstree/Makefile,v retrieving revision 1.18 diff -u -p -r1.18 Makefile --- Makefile 11 May 2013 08:11:12 -0000 1.18 +++ Makefile 20 May 2013 14:48:22 -0000 @@ -2,6 +2,7 @@ COMMENT = list processes as a tree DISTNAME = pstree-2.36 +REVISION = 0 CATEGORIES = sysutils # GPL @@ -11,7 +12,6 @@ WANTLIB = c MASTER_SITES = ftp://ftp.thp.uni-duisburg.de/pub/source/ -USE_GROFF = Yes NO_TEST = Yes WRKDIST = ${WRKDIR} Index: files/pstree.1 =================================================================== RCS file: /cvs/ports/sysutils/pstree/files/pstree.1,v retrieving revision 1.2 diff -u -p -r1.2 pstree.1 --- files/pstree.1 22 Dec 2002 20:25:27 -0000 1.2 +++ files/pstree.1 20 May 2013 14:48:22 -0000 @@ -1,5 +1,5 @@ .\" $OpenBSD: pstree.1,v 1.2 2002/12/22 20:25:27 pvalchev Exp $ -.Dd June 19, 2002 +.Dd $Mdocdate$ .Dt PSTREE 1 .Os .Sh NAME @@ -10,37 +10,40 @@ .Op Fl Uw .Op Fl f Ar file .Op Fl g Ar n -.Op Fl u Ar user -.Op Fl s Ar string .Op Fl p Ar pid -.Op Ar pid ... +.Op Fl s Ar string +.Op Fl u Ar user +.Op Ar rootpid ... .Sh DESCRIPTION Tree sorted output frontend for .Xr ps 1 . .Nm uses the output of the .Xr ps 1 -program to show a nicely formatted process family tree. +program to show nicely formatted process family trees. .Pp -If given one or more -.Ar pid -arguments +For each +.Ar rootpid +argument, .Nm -shows just the branches rooted at the given pids. -By default it starts at pid 1. -(If no argument is given). +shows one tree rooted at that process. +By default, if no +.Ar rootpid +argument is given, it shows a single tree rooted at process 1. .Pp The options are as follows: .Bl -tag -width Ds -.It Fl U -Don't show branches containing only root processes. -.It Fl w -Wide output, not truncated to window width. .It Fl f Ar file Read input from .Ar file -(- is stdin) instead of running +instead of running .Dq ps -kaxwwo user,pid,ppid,pgid,command . +If +.Ar file +is a single dash +.Pq Sq \&- , +.Nm +reads from standard input. .It Fl g Ar n Use graphics chars for tree. .Ar n @@ -48,16 +51,29 @@ Use graphics chars for tree. IBM-850, .Ar n = 2: VT100. -.It Fl u Ar user -Show only branches containing processes of -.Ar user . -.It Fl s Ar string -Show only branches containing process with -.Ar string -in commandline. .It Fl p Ar pid -Show only branches containing process +Show only parents and descendants of the process .Ar pid . +.It Fl s Ar string +Show only parents and descendants of processes containing the +.Ar string +in their commandline. +.It Fl U +Don't show branches containing only root processes. +.It Fl u Ar user +Show only parents and descendants of processes of +.Ar user . +.It Fl w +Wide output, not truncated to terminal width. +.El +.Sh ENVIRONMENT +.Bl -tag -width COLUMNS +.It Ev COLUMNS +The width of the terminal in characters. +This can be set with +.Xr stty 1 Cm columns Ar number . +.Sh EXIT STATUS +.Ex -std .Sh EXAMPLES Show branches of processes containing .Dq \&httpd @@ -70,6 +86,17 @@ Show process number and its descendants: .Pp .Cm $ pstree 15495 +.Pp +Show process number +.Dq \&15495 +and its parents and descendants: +.Pp +.Cm $ pstree -p 15495 .Sh SEE ALSO .Xr ps 1 , .Xr top 1 +.Sh AUTHORS +The program was written and is maintained by +.An Fred Hucht Aq [email protected] , +the manual page was initially set up by +.An Sebastian Stark Aq [email protected] .
